Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A normal HTTP request may look something like this:

GET / HTTP/1.1
Host: example.com

I would like to change the first line of this request, with a custom one, e.g.:

Host: example.com

Is it possible to do this using curl or this there another tool, capable of doing this?

share|improve this question
up vote 8 down vote accepted

You can do this by using tool netcat(also called as nc).

Just from command line, do the following steps to send the modified request.

$ nc <ip-address-of-webserver> 80
  Host: example.com
share|improve this answer

curl is only able to speak a couple of well defined protocols. What you are trying to do is no valid http nor any valid other protocol.

If you really want to do it this way you can simply send your text for example using netcat.

share|improve this answer

There are 2 options: telnet example.com 80 and nc example.com 80

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.