http-console icon indicating copy to clipboard operation
http-console copied to clipboard

POST / PUT data in readme misleading

Open bbn opened this issue 15 years ago • 6 comments

Browsing the code I was able to figure out that in order to send multiple datums for POST I had to use a syntax like

x=1&y=2

rather than something like

{"x":1,"y":2}

The latter would be cool, but seems to not be supported at the moment. The former is fine but the documentation should be changed to reflect it.

bbn avatar Jul 30 '10 20:07 bbn

They both work actually, it depends what the server accepts. It's just raw data, so in the later case the server needs to parse it as json. http-console doesn't care what you type in there.

cloudhead avatar Jul 30 '10 23:07 cloudhead

understood.

bbn avatar Jul 31 '10 00:07 bbn

I'd like to humbly predict that inserting a super-brief explanation of typical formatting of POST arguments from a regular HTML web form will save other people time. I'm not the sharpest pencil in the drawer, but I'm also not atypical, and it cost me about an hour of poking around.

bbn avatar Aug 01 '10 01:08 bbn

Good idea.

cloudhead avatar Aug 02 '10 17:08 cloudhead

Got POST with form data to work: $ http-console localhost $ http://localhost:80/> /myapp/ $ http://localhost:80/myapp/login.php> Content-type: application/x-www-form-urlencoded $ http://localhost:80/myapp/login.php> post $ ... username=admin&password=admin

kamweti avatar Sep 14 '12 08:09 kamweti

@bbn Thanks for the explanation cause the readme was not working for me. :+1:

bcaccinolo avatar Apr 02 '14 14:04 bcaccinolo