Chapter 2 Intro to REST
When we talk about our API, we use terms like “REST” and “RESTful.” “REST” stands for Representational State Transfer.
It’s an architectural style that’s an alternative to RPC or SOAP-based web services.
While there’s no official REST standard, there are common approaches and best practices used across the engineering community that help define how RESTful APIs should work. For example, most RESTful APIs follow six specific constraints or design rules.
Most APIs aren’t fully RESTful, including our API. But we follow most of the practices and common definitions of the style. For example, our API has what we call “resources,” which are typically nouns like “pages” or “notices.” You take action on resources using the standard HTTP methods: POST, GET, PUT/PATCH, and DELETE.
No support for PUT / PATCH / DELETE?
Some older HTTP clients or restrictive firewalls don’t allow you to make PUT, PATCH or DELETE requests. To work around this we allow you to make standard POST requests with the addition of an
X-HTTP-Method-Override header which defines the method you actually want to trigger.
curl -X POST https://api.sorryapp.com/v1/pages/6ad9e9e8 \ -d name="My Example Status Page" \ -H "X-HTTP-Method-Override: PATCH" \ -H "Authorization: Bearer 0526ff9fdbb3ca728daa3d17781eac1a15a1c3f0917abc53394d17ecdc8a8751"