New: Try Voli The Bear, Fast package manager (and not only) for Windows
All topics / HTTP & JSON: the API Building Blocks

HTTP & JSON: the API Building Blocks

Every web API is made of two things: HTTP carries the message, JSON carries the data. Learn both well enough to read any API call with confidence.

Download EPUB
  1. HTTP, the Transport A web API rides on HTTP: every call is a request (method + URL + headers) and a response (status code + headers + body). Here's the API-shaped recap.
  2. JSON, the Data Format JSON is structured data written as text: objects, arrays, strings, numbers, booleans, and null. It won because it's human-readable and language-neutral. Here's how to read and write it.
  3. A Real API Call Put HTTP and JSON together: GET a JSON API and read the response, then POST a JSON body with the right headers. Annotated curl transcripts of both.