views:

46

answers:

1

I am looking for an easy way to re-send POST request to the server within the browser mainly for debug purposes. Say you have a XHR request which contains POST parameters that is to be send to the server. After having changed the script on the server side, you would like to resent the very same request for analyzing the output.

What tool could help? I guess it is a browser's extension.

I already tried extension Tamper Data for Firefox which does the job as you can "Replay in browser". But for my taste, it is not enough straight forward, as there are 3 - 4 clicks to get the result of the request.

Unfortunately, curl would not be suitable for my needs as my application has a session's cookie.

A: 

You can use cookies with cUrl. If the cookies is created on login, you can login using cUrl, saving the cookie to a file:

curl -c cookies.txt -d "user=username&pass=password" http://example.com/login

And then to load them for the subsequent requests:

curl -b cookies.txt ...

If for some reason the cookie can't be created using a cUrl request, you can use the Firefox extension Cookie Exporter, which produces files that can be read by curl using the -b flag.

André Paramés