Friday, September 21, 2007

Testing an Http POST from the command line

Got a REST web service update using an Http POST that you want to test? If so, run this command:

curl --header "Content-Type: text/xml" --data '' "" –i

And get this result:

HTTP/1.1 200 OK
Date: Fri, 21 Sep 2007 00:43:08 GMT
Set-Cookie: JSESSIONID=4EB1673F5BD20FF0495A9FBB38017C38; Path=/myapp
Content-Type: text/xml;charset=ISO-8859-1
Transfer-Encoding: chunked

You can easily time it using:

time curl --header "Content-Type: text/xml" --data '' "" –i