asciimoo / wuzz

Interactive cli tool for HTTP inspection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

POST data broken?

somebehemoth opened this issue · comments

Awesome tool! I have a question. The following request returns HTTP status code 415:
wuzz -X POST -d "name=request-size-limiting" http://localhost:8001/apis/mockbin/plugins/

Whereas the following curl command works as expected against the same API:
curl -X POST --url http://localhost:8001/apis/mockbin/plugins/ --data "name=request-size-limiting"

I've tried various permutations of the POST data without success. Is there any way to see the actual request that wuzz is making (I am curious to inspect the format of POST data)? I've tried building this request in wuzz UI with the same 415 response.

Again, this tool is awesome. Thank you for building wuzz!

@somebehemoth probably your webapp requires correct content-type header to accept post data.
Try to add -H 'Content-Type: application/x-www-form-urlencoded' to the request

@asciimoo Thank you, that works exactly as expected.

@asciimoo should we set the Content-Type: application/x-www-form-urlencoded by default on POST requests, at least when setting from the command line? The given example seems to indicate that cURL does this, so we might want to emulate that behavior.

If not, this issue should be good to close.

@asciimoo should we set the Content-Type: application/x-www-form-urlencoded by default on POST requests, at least when setting from the command line?

Yes, this is definitely a good idea, I'll do it.