-
Book Overview & Buying
-
Table Of Contents
Hands-On Software Engineering with Python - Second Edition
By :
Before diving into the design of the REST API, there are some terms that should be defined in relation to how a REST API functions. The first are typical HTTP methods (also commonly called actions or verbs) that determine what is expected in a request structure, and what kinds of response data are required or expected for them.
GET requests simply ask for data, and the responses to them will include that data, if it is available. GET requests are what browsers send when requesting a web page, and a GET request is no different from that perspective. GET requests are only allowed to send one content type (x-www-form-url-encoded), which is likely sent by default by a browser, if it is sent at all. Responses to GET requests should include a content-type specification, with application/json, indicating JSON data, being the most relevant for the current discussion.
HEAD requests are identical to GET requests, except that they return no response content, just the...