nodules / asker

http.request wrapper with gzip, request retries and http.Agent tuning
MIT License
93 stars 11 forks source link

compile request body without method check if `options.body` passed #1

Closed kaero closed 11 years ago

kaero commented 11 years ago

Update: issue title was "compile request body from query option instead of body"

kaero commented 11 years ago

We must keep compatibility (compile POST, PUT and PATCH requests body from query and body with body(?) in prior) or bump minor version.

Flackus commented 11 years ago

I guess it's better to write synthetic tests first. node-request tests may be taken as an example.

kaero commented 11 years ago

I've a much progress with tests now. You can cook the fix and we'll apply it when tests will be done (;

Flackus commented 11 years ago

Ok, nice. Can help with the tests, when theirs skeleton would be ready.

kaero commented 11 years ago

I'd discussed this issue with @webstalk3r, and I decide to compile request body always when it's provided in the options.body and so asker mustn't merge body and query options. Using body for GET or DELETE methods may be not so RESTful, but it's not meaningful if you server can correctly parse the request and reponse to it.