astaxie / bat

Go implement CLI, cURL-like tool for humans
Apache License 2.0
2.55k stars 220 forks source link

Querystring parameter setting operator is inconsistent #19

Open glkz opened 9 years ago

glkz commented 9 years ago

param=value's behavior changes with http method. So user interface changes between http requests whereas the http resource is the same.

For example:

bat GET api.example.com/person/1 apiKey=smellsbad
//apiKey is in the querystring
bat PUT api.example.com/person/1 apiKey=smellsbad
//apiKey is in the request body 

Also, there is no other option to add querystring parameters to post/put/patch requests other than manually adding them to url.

I think, a consistent assign operator for querystring params would be nice. We can adopt httpie's == for this.

astaxie commented 9 years ago

I think Get will always send the params while not body. http://stackoverflow.com/questions/978061/http-get-with-request-body

while other will always add as the post data

glkz commented 9 years ago

I have no objection to "GET requests should not contain body" idea/convention.

However, I think a common option (like ==) to send querystring parameters for all http methods would be good.