tags:

views:

1029

answers:

3

While building a small experimental HTTP server, I need to implement the persistent connection feature of HTTP 1.1 (and the pipelining feature). How do I test it? Using a browser like Firefox gives me little or no control, and it's hard to check. Any ideas?

Thanks

+1  A: 

curl(http://curl.haxx.se/) -- gives you very good control over GET/POST and many other attributes.

curl also comes with libcurl so that you can do things programatically.

Perl and python(urllib or urllib2 ) will help you get there.

anjanb
A: 

ab, or ApacheBench is a commandline benchmark for HTTP servers. The -k option makes it use KeepAlive.

Javier
A: 

Netcat. You can type in the request(s) and see the response(s) from the server. If you know the HTTP protocol, it's not a problem at all. In fact, it's better than curl or other higher-level libraries/applications, since here you can send whatever you like (malformed requests) and test the corner cases in your server's behavior. You can also redirect the input (and output), which is especially useful when you want to test HTTP/1.1 request pipelining. Keep in mind that sending CRLFs in Unix using Netcat is harder than on Windows, where you can simply press Enter.

Alexander