gamache / hyperresource

A self-inflating Ruby client for hypermedia APIs. Not under active development.
http://hyperresource.com/doc
MIT License
304 stars 29 forks source link

Content-type application/x-www-form-urlencoded #35

Open mynameisrufus opened 9 years ago

mynameisrufus commented 9 years ago

I think given a response for a resource that has a Content-type: application/json, when you make a PUT or POST to it, it would be nice if it assumed the content type was the same. Currently hyperresource sets the header as Content-type application/x-www-form-urlencoded.

I worked around it by doing this:

HyperResource.new(
  headers: {
    'Accept' => 'application/vnd.trowel-v5+json',
    'Content-Type' => 'application/json'
  }
)