From the discussion in #108, this adds support for a format parameter, and sets reasonable default content types when neither a content type nor a format is provided.
For now, the format parameter is only used to decide on a Content-Type header. However, it could be used in the future to set accept headers, automatically manipulate payloads (e.g. format: :json might result in the payload being converted to a JSON string before sending), etc.
Formats provided are:
When a format is not provided, the default is form_encoded. However, if there is a hash-based payload or files to upload, it defaults to form_data instead.
Add a format option for setting the Content-Type
Set the Content-Type based on the format parameter or payload
Awesome. I'm going to have to bump the version and release a gem. I'd like to also give you commit access and welcome you to the team!
Great, thanks for the access!