What is a Web Request?
A web request is a communicative message that is transmitted between the client, or web browsers, to the servers. This request is essential in providing the user with the correct and preferred webpages that the server will then display on the user’s interface. The server then retrieves the content requested by the client that will result in the webpages, images or interactive features displayed. Per each request sent on behalf of the client, the server will complete each one thus loading the respective amount of webpages, images or elements.
How Does a Web Request Work?
A web request can also be known as an HTTP request which is the protocol that interacts between the client and the server. A client will type in a URL address prompting the web request to the server. The client or web browser will then connect to the server that it’s seeking information and data from. If the website exists and can be located then the request will continue to be processed. If the website cannot be located, an HTTP 404 “Page Not Found” message will revert back to the client. Once the request has been completed, however, that initial connection has ended and a new one must be made for every additional request made thereafter. Furthermore, within a webpage that has been requested, smaller elements such as visual imagery, videos, or other interactive content will begin to send HTTP requests of their own. Once all requests have been completed for a webpage, the user will be able to interact with all the capabilities and features displayed.
Types of Web Requests
While an HTTP request is the mode of communication between the client, that’s requesting data, and the server, that’s supplying data, there are various purposes and actions behind the types of web requests that can be made.
GET: A get request is one of the most common web requests that can be made. This type of request is made on behalf of a client when it’s seeking data from a specified resource. Once the client has made a request for a resource, the server will then process the request, get the information or data and send it back to the client.
POST: This is another common type of web request but the purpose of POST seeks to create or update the subordinate requested resources. This request does not store additional data but instead per request must be updated and refreshed or resubmitted. Furthermore, each time this request is made, it makes it clear to the user that it will need to be resubmitted.
PUT: This method can allow for the target URL to be entirely replaced with a new resource. PUT should be utilized to replace or overwrite a resource that the client is clearly aware of.
PATCH: This method is simply used to modify a specific part of the resource. While it is similar to the PUT method, PATCH aims to only update or modify rather than replace.
DELETE: This method sends a request to the server to delete a resource. While this is a possibility, it is not the most preferred choice.
A Web request is a request issued by a Web client. A Web request can be described as either:
Explicit Web request:
A request that is initiated manually by the user.
Implicit Web request:
A request that is initiated transparently by the Web client, without manual intervention on the part of the user, as an ancillary event corresponding to an explicit Web request.
and as either:
Embedded Web request:
A request for dereferencing a URI embedded within a Web resource manifestation: e.g., following the link in an HTML document, etc.
User-input Web request:
A request for dereferencing a URI supplied by the user directly to the Web client: e.g., typed into the address window, bookmarks, history, etc.
Examples: a) A user follows a link appearing in a HTML document (explicit, embedded Web request). The Web client retrieves the requested HTML document, and also makes an additional request for an image referenced in the HTML document (implicit, embedded Web request); b) A user reads the URI printed on a bus and feeds it to the Web client (explicit, user-input Web request).