Ian Littman / @ian@phpc.social / @iansltx
follow along at https://ian.im/apitek23
pro tip: start with chapter 5
GET /gyros Accept: video/mp4 {other headers here} HTTP/1.1 200 OK Cache-Control: public, max-age: 3600 Content-Type: video/mp4 Date: Thu, 18 May 2023 16:05:00 GMT Vary: Accept-Encoding Content-Length: 20230518 Connection: keep-alive X-Powered-By: Battle Snake
Client-server interactions can/should be streamed
* They may be the best way to pass auth back and forth
An interesting observation is that the most efficient network request is one that doesn't use the network.
- Roy Fielding
HTTP/1.1 304 Not Modified Cache-Control: public, max-age: 3600 ETag: a1234b1234 Content-Type: application/json Date: Fri, 18 May 2023 16:13:37 GMT Vary: Accept-Encoding Content-Length: 42 Connection: keep-alive X-Powered-By: An Elephpant
If-Modified-Since If-None-Match Vary
Since REST is specifically targeted at distributed information systems, it views an application as a cohesive structure of information and control alternatives through which a user can perform a desired task.
- Roy Fielding
An architecture for the web must therefore be designed with the context of communicating large-grain data objects across high-latency networks and multiple trust boundaries.
- Roy Fielding
Content-Type
Last-Modified
Resource Metadata
Source link
Alternates
Vary
Control Data
If-Modified-Since
Cache-Control
Accept
Content-Type
POST /tokens HTTP/1.1 201 Created Cache-Control: no-cache, no-store Content-Type: application/hal+json Date: Thu, 18 May 2023 16:20:24 GMT Content-Length: 337 X-Powered-By: COBOL ON COGS 10.11.0
POST /tokens Accept: image/png HTTP/1.1 201 Created Cache-Control: no-cache, no-store Content-Type: image/png Date: Thu, 18 May 2023 16:21:26 GMT Content-Length: 1337 X-Powered-By: Bacon
POST /tokens Accept: text/xml HTTP/1.1 406 Not Acceptable Cache-Control: no-cache, no-store Date: Thu, 18 May 2023 16:22:28 GMT Content-Length: 123 X-Powered-By: Fresh Outta Angle Brackets
...but know why you're picking a tool for the job
ian.im/apitek23 - these slides
phpc.social/@ian - me!
twitter.com/iansltx - also me
github.com/iansltx - my code!
<- rate this talk