electronic devices such as printers, scanners that are connected via cables or wireless radio wave. In which, a device is called a node and all nodes can exchange data with each others. 6
and share resources for all clients connects to it. A Client is a computer or device (such as a personal computer) that can access resources from the server. 14
• Hypertext Transfer Protocol (HTTP) • File Transfer Protocol (FTP) • Secured Shell (SSH) • Simple Mail Transfer Protocol (SMTP) • Domain Name System (DNS) • Post Office Protocol version 3 (POP 3) • ... 18
Accept: text/plain, text/html [Message Body] First Line: - GET - is the method. - /example - is the path info and query string. - HTTP/1.1 - is the protocol version Next lines: - The listing of header fields. - A header field is a pair name: value. Finally: - The request body is optional. 20
09 Oct 2010 14:28:02 GMT Server: Apache Accept-Ranges: bytes Content-Length: 29769 Content-Type: text/html <!DOCTYPE html... (here comes the 29769 bytes of the requested web page) First Line: - HTTP/1.1 - is the protocol version. - 200 is the status code. - OK is the status text. Next lines: - The listing of header fields. - A header field is a pair name: value. Finally: - The response body. 21
requests a representation of the specified resource. Requests using GET should only retrieve data. HEAD The HEAD method asks for a response identical to that of a GET request, but without the response body. 23
is used to submit an entity to the specified resource, often causing a change in state or side effects on the server. PUT The PUT method replaces all current representations of the target resource with the request payload. DELETE The DELETE method deletes the specified resource. PATCH The PATCH method is used to apply partial modifications to a resource. 24
Identifier (URI) is a string of characters that unambiguously identifies a particular resource. URI = scheme:[//authority]path[?query][#fragment] authority = [userinfo@]host[:port] 25
requests and responses but with no relation to the data eventually transmitted in the body. Request Header Headers containing more information about the resource to be fetched or about the client itself. Response Header Headers with additional information about the response, like its location or about the server itself (name and version etc.). Entity Header Headers containing more information about the body of the entity, like its content length or its MIME-type. 28
(Informational): The request was received, continuing process 2xx (Successful): The request was successfully received, understood, and accepted 3xx (Redirection): Further action needs to be taken in order to complete the request 4xx (Client Error): The request contains bad syntax or cannot be fulfilled 5xx (Server Error): The server failed to fulfill an apparently valid request
to the server. 2. The client sends an HTTP request the server. 3. The server handles the incoming HTTP request and returns an HTTP response. 4. The client receives and reads the HTTP response. 5. The client closes or reuses the opening connection for the other requests. 32
Send an HTTP Request via Browser, CURL and HTTPie. 3. Return an HTTP Response. a. Interact with Status. b. Interact with Content-Type. c. Interact with customized headers. 38