Server Fault is a question and answer site for system and network administrators. 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

I'm looking for a command line tool that acts as simple http "server" in that it can print the requests made to it to the console and reply with 200. In particular, it needs to support POST commands.

share|improve this question
I think, you mean command line web browsers, right? – Suku Apr 3 '11 at 7:55
No, I mean command line http server – IttayD Apr 5 '11 at 4:10
up vote 1 down vote accepted

Netcat will do it, if I am understanding you properly.

I like to use the version of netcat from here as it does not have the security issues associated with the -e option.

Now create a text file containing something like:

echo HTTP/1.0 200 OK

<h1>hello world</h1>
<form method="post">
send something: <input type="text" name="postText" />
<input type="submit" value="Submit" />

If you run the following on the command line, where page.txt is the name of your text file above, netcat will act as a one line webserver.

for /l %a in (1,0,2) do type page.txt | nc -w 1 -l -p 80 | findstr "postText"

Connecting to http://localhost will show the web page above. Typing something in the "send something" box and pressing submit will show the value submitted on the command line where you ran netcat. The "-w 1" (disconnect after one second) is a bit of a fudge to get netcat to behave like a web server, but it works, all be it with a one second delay.

You could even use a batch file to return some http which is dependant on what you posted, by redirecting the entire output of the command to the batch file, and using a set /p in a loop, looking for "postText=".

share|improve this answer

The no-setup single executable mongoose

Or if you have python installed, there is the built-in SimpleHTTPServer module

python -m SimpleHTTPServer 8000

Note: if you have OpenOffice or LibreOffice installed, you also have python ;-)

Example : 3.4.1

C:\Program Files\ 3\Basis\program\python-core-2.6.1\bin

share|improve this answer

You might look into a win32 port of Netcat called NCat. Look at this page for an example of NCat in listen mode: to see how to get the 200 result code you specified.

You might also look at:

It is a command line web server, with no bells - may also provide what you are looking for.


share|improve this answer
thanks. netcat doesn't support POST, tinyweb rejects all POSTs I send to it. – IttayD Apr 5 '11 at 4:10
Alright - any other requirements? – RobW Apr 5 '11 at 5:04
Looking over the docs for Tinyweb, the author says it supports post and get. You might contact the author with the error you have. You might also look at The author says it has a limited post function. – RobW Apr 7 '11 at 4:41

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.