HTTP is a protocol that is easy to learn the basics of. A client connects to a
server—and it is always the client that takes the initiative—sends a
request and receives a response. Both the request and the response consist of
headers and a body. There can be little or a lot of information going in both
directions.

An HTTP request sent by a client starts with a request line, followed by
headers and then optionally a body. The most common HTTP request is probably
the GET request which asks the server to return a specific resource, and this
request does not contain a body.

When a client connects to ‘example.com’ and asks for the ‘/‘ resource, it
sends a GET without a request body:

If the client would instead send a request with a small request body
(‘hello’), it could look like this:

A server always responds to an HTTP request unless something is wrong.

So when a HTTP client is given a URL to operate on, that URL is then used,
picked apart and those parts are used in various places in the outgoing
request to the server. Let’s take the an example URL:

  • /path/to/file is used in the HTTP request to tell the server which exact
    document/resources curl wants to fetch

The path part of the URL is the part that starts with the first slash after
the host name and ends either at the end of the URL or at a ‘?’ or ‘#’
(roughly speaking).

To prevent curl from squashing those magic sequences before they are sent to
the server and thus allow them through, the option exists.