views:

35

answers:

2

I'm writing a simple HTTP server which should play nicely with most clients, but is only meant to implement a subset of HTTP 1.1.

During development it would be nice to be able to validate that the generated HTTP reponses are HTTP 1.1 compliant. Is there a tool that can do something along those lines?

Thanks /Erik

A: 

You could just write unit test cases using any http client library. Make GET and POST requests to your webserver, parse the response and make assertions. As you add additional features, add more test cases.

For example, lets say you only support url-encoded POST requests. So, you write a test case which verifies your server understands url-encoded requests and responds appropriately. Tomorrow, when you add support for multi-part support - that would be another test case altogether.

Every programming language under the sun has good support for HTTP, so writing the test case is a no-brainer.

sri
+1  A: 

It's not a complete conformance suite, but RED does check for a number of different HTTP requirements, and finds common problems.

http://redbot.org/

Mark Nottingham
Great tip, thanks! Exactly what I was looking for.
Erik Öjebo