HTTP and REST - 401-advanced-javascript-Mai/amman-javascript-401d1 GitHub Wiki

HTTP (HyperText Transfer Protocol)

-request response application. -server. -it defines how to request-response should be formatted. -associated with serving file( .html , .json , image , ...) .


HTTP Requests

it contain headers (method , URL , HTTP version )

HTTP Response

it contains ( HTTP version, status code, status message )


REST(REpressentational state transform )

-THE endpoint is URL identifies the resource. -verbs(it's a set of method ) -performing CRUD operation over HTTP.

## 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

-the endpoint pf RESTful delivers data in JSON (generally).


REST Documentation (Swagger) a “live” documentation system: Open API (formerly “Swagger”) how to use API.