Read: Class 06 - 401-advanced-javascript-dania/amman-javascript-401d1 GitHub Wiki

  1. HTTP The Hyper Text Transfer Protocol (HTTP) is a stateless request-response application layer protocol. HTTP is used to build distributed, collaborative, hypermedia information systems. HTTP is often associated with serving .html files but is also used to transfer images, videos, .json, .xml, binary executables, and much more.

  2. HTTP Requests A HTTP/1.1 request is formatted in text and transferred using TCP. The first line of the request contains the METHOD, URL, and HTTP VERSION. The following lines are the request HEADERS.

  3. HTTP Response A HTTP/1.1 response is also formatted in text and transferred using TCP. The first line of the response contains the HTTP VERSION, STATUS CODE, and STATUS MESSAGE

  4. REST REST is acronym for REpresentational State Transfer

RESTful Endpoint: http://api.server.com/api/v1/people

  • http:// - Protocol/Scheme
  • api.server.com - Domain or Server
  • /api/v1 - API Endpoint
  • /people - The resource (This identifies a collection: all people)
  • /people/12345 - A more specific resource: The person with id 12345
  1. REST Documentation (Swagger) The standard for documenting REST APIs is with a “live” documentation system: Open API (formerly “Swagger”)
  2. swagger Swagger is a set of open-source tools built around the OpenAPI Specification that can help you design, build, document and consume REST APIs. The major Swagger tools include:
  • Swagger Editor – browser-based editor where you can write OpenAPI specs.
  • Swagger UI – renders OpenAPI specs as interactive API documentation.
  • Swagger Codegen – generates server stubs and client libraries from an OpenAPI spec.