"Best Practice in API Design" talk given at phpday 2012 in Verona, Italy. This talk aims to give the best possible advice to anyone publishing a web service of any kind.
16. HTTP Headers
Headers are the metadata about the content we send/receive
Useful headers:
• Accept and Content-Type: used for content format negotiation
14
18. HTTP Headers
Headers are the metadata about the content we send/receive
Useful headers:
• Accept and Content-Type: used for content format negotiation
• User-Agent: to identify what made the request
16
19. HTTP Headers
Headers are the metadata about the content we send/receive
Useful headers:
• Accept and Content-Type: used for content format negotiation
• User-Agent: to identify what made the request
• Set-Cookie and Cookie: working with cookie data
16
20. HTTP Headers
Headers are the metadata about the content we send/receive
Useful headers:
• Accept and Content-Type: used for content format negotiation
• User-Agent: to identify what made the request
• Set-Cookie and Cookie: working with cookie data
• Authorization: controlling access
16
23. HTTP Verbs
• More than GET and POST
• PUT and DELETE to update and delete in a RESTful service
• HEAD, OPTIONS and others also specified
GET Read
POST Create
In REST, we use:
PUT Update
DELETE Delete
19
33. RESTful Services
• REpresentational State Transfer
• URLs are unique resource identifiers
• HTTP verbs indicate which operation should happen
• We have full CRUD operations on a series of resources
29