Basic Anatomy of HTTP Requests
HTTP communications mainly consist of an HTTP request and an HTTP response. The client makes An HTTP request and is processed by the server. The requests contain all of the details we require from the server, including the resource.
An HTTP request is a message sent via an internet browser to a web server. It includes numerous components:
- HTTP method: The HTTP approach specifies the type of request being made, including GET, POST, PUT, DELETE, and many others. It shows the intended movement to be performed on resources.
- URL (Uniform Resource Locator): The URL specifies the region of the aid at the server. It includes a scheme (e.g. HTTP or HTTPS), domain name, path etc.
- Headers: Provides additional information about the request like content type, authentication, cookies etc.
- Request body: Contains optional data sent with request mainly in POST, PUT, and PATCH requests to send data.
How to make an HTTP GET request manually with netcat?
Netcat,also known as “nc”, is a powerful Unix-networking utility that enables users to interact with network services through a command-line interface (CLI). It uses both TCP and UDP network protocols for communication and is designed to be a reliable back-end tool to instantly provide network connectivity to other applications and users. Although Netcat is more often known for its use in file transfers and port scanning, it can also act as an HTTP client and send and accept raw HTTP requests.