- Http protocol always organized in sending Clients requests to the Server
- Key parts of the HttpRequest is: Action client is asking server to take on behalf of the client.
- Every request has a request method contains action to take
- All requests applied to the specific resource on the server. For example, accessing a webpage asking get request to get resource ../..*.html
- Request to find the resource in the server (eg: /app/mypage.html)
- Http Request methods - Get, Post, Put and Delete
- Get is a simple request to the server can be without data or little data.
- Post is typical used if you want to send lots of data to the server (for eg: sending image to the server)
- Put is asking the server to store the data on the server.
- Delete is asking server to delete some resource.
- Format of the HttpRequest: <RequestMethod><Resource><Headers>(Extra information to help the server to assist with<ContentType><Cookie><RequestBody>
- How to find the client requesting the data from the server. In server look for HttpRequest Header information.
- How to identify resource from client? - URL (Uniform Resource Locator) http://host:port/path
- Query parameters provides additional information required to filter the data. Eg: URL?<Key><value>
- Multiple query parameters accepted by servers: Eg: URL?<key><value>&<key><value>
- URL encoding allows to pass a value that aren't allowed by replacing with the supported characters.
- Http Response Codes displays in the status line <ResponseCode><Text Description>
- Http Response contains Series of Headers to send Meta information to the clients. Body of the response, which is actual data.
- Http Codes: 1xx - Information about the request, 2xxx - Successful request codes, 3xxx - Redirection(Resource moved in server and find in other location), 4xxx - Errors trigged by clients requested resource, 5xxx - Server errors
No comments:
Post a Comment