Most modern REST APIs send and receive data as JSON, which sits inside the request or response body while HTTP methods and status codes handle the "action" side of the conversation.

How JSON fits into the request/response cycle

  • A POST request typically sends a JSON object in the body describing the resource to create
  • A GET response typically returns a JSON object or array representing the requested resource
  • The Content-Type: application/json header tells both sides how to interpret the body

Common junior-developer pitfalls

Forgetting to JSON.stringify() an object before sending it, or forgetting to parse a response before trying to access its properties, are two of the most common early mistakes — both result in errors that look confusing until you recognize the pattern.

Debugging your first API integration

When something doesn't look right, paste the raw request or response body into a JSON formatter to confirm it's valid and see the actual structure clearly, rather than trying to read a dense, unformatted string in your browser's network tab.

Ready to try it? Jump back up to the JSON Formatter & Validator.