Read: Class 06 HTTP and REST - Goorob-401-advanced-javascript/amman-javascript-401d1 GitHub Wiki

  • 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.
  • The HTTP specification defines how requests and responses should be formatted .
  • HTTP is often associated with serving .html files but is also used to transfer images, videos, .json, .xml, binary executables, and much more.
  • HTTP Requests :
  • The first line of the request contains the METHOD, URL, and HTTP VERSION. The following lines are the request HEADERS.
    • Each header is separated by a newline character .
    • A header is a key value pair separated using a colon. Headers containing more than one value separate each value using a semicolon
    • The header section of the request is terminated with an empty line. An optional body follows the header section .
  • HTTP Response :
    • The first line of the response contains the HTTP VERSION, STATUS CODE, and STATUS MESSAGE
    • The following lines are the request headers and are formatted exactly the same way as the request headers
    • The header section of the request is terminated with an empty line. An optional body follows the header section.
  • REST :
    • REST is acronym for REpresentational State Transfer
    • Rest uses a common set of methods (called “verbs”) to operate on the state of a resource (“noun”), generally using HTTP as the transfer protocol.
    • A “RESTful Endpoint” is a URI that identifies the resource. When addressed with a proper method, you are able to effect state. In normal terms, this means “Performing CRUD operations over HTTP”
    • REST Documentation (Swagger) :The standard for documenting REST APIs is with a “live” documentation system: Open API (formerly “Swagger”)