How to use APIs with JavaScript
Anatomy of a Request

An HTTP request is made up of three parts:

  1. The request line, which tells the server what kind of request is being sent (GET, POST, etc.) and what resource it's looking for;
  2. The header, which sends the server additional information (such as which client is making the request)
  3. The body, which can be empty (as in a GET request) or contain data (if you're POSTing or PUTing information, that information is contained here).

Check out the text in the editor. This is what a typical request looks like! Note the POST information in the request line, the header information below it, and the data to be POSTed at the bottom (line 5).