Closed justincy closed 8 years ago
The best characteristic of the proposed change is that the order of parameters doesn't have to be remembered. I have trouble remembering the order even though I decided on it yesterday and have been using it quite a bit since then.
Here's how to currently POST to a URL with a JSON body:
The two
null
s in the middle bother me. They are the query params and headers variables. Those need to be available for setting on a POST but the user shouldn't have to specify that they won't be setting them.We can't cant change the order because then it won't match the parameter order of
get()
andrequest()
. Though we might change the parameter order ofrequest()
, we would end up with other situations where we're passing in null (you can pass an empty array too).A better way to do this is using an options object.
Is that much better?