Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
Nächste SlideShare
Hardcore HTML
Hardcore HTML
Wird geladen in …3
×
1 von 23

HTTP is Hard

0

Teilen

Herunterladen, um offline zu lesen

Ähnliche Bücher

Kostenlos mit einer 30-tägigen Testversion von Scribd

Alle anzeigen

Ähnliche Hörbücher

Kostenlos mit einer 30-tägigen Testversion von Scribd

Alle anzeigen

HTTP is Hard

  1. 1. HTTP is HARD Eric Redmond makes Riak @coderoshi Wednesday, November 13, 13
  2. 2. HTTP? • Hyper-Text Transport Protocol • Client Request -­‐> Server Response • Stateless Wednesday, November 13, 13
  3. 3. HTTP Response Codes • HTTP/1.1 200 OK • Ranges have meaning (classes) • • • • • Wednesday, November 13, 13 100-199 - Informational 200-299 - Success 300-399 - Further Client Action 400-499 - Client Error 500-599 - Server Error
  4. 4. 1xx - Informational • 100 Continue • 101 Switching Protocols • 102 Processing Wednesday, November 13, 13
  5. 5. 2xx - Success • 200 OK • 201 Created • 202 Accepted • 203 Non-Authoritative Information • 204 No Content • ... Wednesday, November 13, 13
  6. 6. 3xx - Client Action • 300 Multiple Choices • 301 Moved Permanently • 302 Found • 303 See Other • 304 Not Modified • ... Wednesday, November 13, 13
  7. 7. 4xx - Client Error • 400 Bad Request • 401 Unauthorized • 402 Payment Required • 403 Forbidden • 404 Not Found • ... Wednesday, November 13, 13
  8. 8. 5xx - Server Error • 500 Internal Server Error • 501 Not Implemented • 502 Bad Gateway • 503 Service Unavailable • 504 Gateway Timeout • ... Wednesday, November 13, 13
  9. 9. http://codes.io/200 Wednesday, November 13, 13
  10. 10. Client Methods • POST • GET • • Wednesday, November 13, 13
  11. 11. Client Methods • POST • GET • PUT • DELETE Wednesday, November 13, 13
  12. 12. Client Methods • POST • GET • PUT • DELETE Wednesday, November 13, 13 • Create • Read • Update • Delete
  13. 13. More Methods? • HEAD • OPTIONS • TRACE • CONNECT • PATCH Wednesday, November 13, 13
  14. 14. Learning from The Wrong Way Wednesday, November 13, 13
  15. 15. curl -H "Content-type: application/json" http://localhost:35357/v2.0/tokens -d '{"auth":{"passwordCredentials": {"username": "joeuser", "password": "secret"}}}' Wednesday, November 13, 13
  16. 16. curl -H "Content-type: application/json" -H "Authorization: Basic am9ldXNlcjpzZWNyZXQ=" http://localhost:35357/v2.0/tokens Wednesday, November 13, 13
  17. 17. riak.com.cn docs.basho.com Wednesday, November 13, 13 汉语 English
  18. 18. https://raw.github.com/wiki/basho/webmachine/images/http-headers-status-v3.png Wednesday, November 13, 13
  19. 19. Wednesday, November 13, 13
  20. 20. Wednesday, November 13, 13
  21. 21. A Sad History Wednesday, November 13, 13
  22. 22. http://github.com/coderoshi/ webmachine-nodejs Wednesday, November 13, 13
  23. 23. Parting Thoughts Wednesday, November 13, 13

×