Open BrandonRomano opened 9 years ago
I think Wrecker should be able to determine the default content type based on the parameters that have been included. For example, if there's a BODY, then set the Content-Type to "application/json". Otherwise, set it to "x-www-form-encoded". Then, this could be overridden by the new function .ContentType()
Once we get to executing the request, we can switch on the Content-Type to choose the encoder (Form, JSON, or XML)
EDIT: This means that we could probably remove the DefaultContentType property on the Wrecker object. It should be simple enough to determine that from the properties of each request.
Okay, yeah I agree... Let's do that!
Hey @benpate I've updated this issue's description to match what we want to do with this now.
Realized in #14 we should probably add this.
Probably
ContentType
would be a good function name for this.sendRequest
(Explicit value set withContentType
would always be picked over the calculated ones)