node-oauth icon indicating copy to clipboard operation
node-oauth copied to clipboard

Add support for setting Content-Type on GETs

Open dancrumb opened this issue 11 years ago • 3 comments
trafficstars

The current implementation forces the Content-Type header to be "application/x-www-form-urlencoded", when using consumer.get.

Some services do not support this Content-Type header on a GET. Whether they are right or wrong to do this, it makes it impossible to use .get for these endpoints.

I propose support for a default Content-Type header, settable via the customHeaders parameters of the constructor and overridable via the post_content_type parameter of _performSecureRequest

dancrumb avatar Feb 14 '14 17:02 dancrumb

This is affecting me too. This should certainly be overridable. It should also be possible to leave Content-Type unset for methods that don't contain bodies. Content-Type is meaningless on a GET, HEAD, or DELETE request.

hairyhenderson avatar Jun 24 '14 01:06 hairyhenderson

+1

mitchellporter avatar Jun 14 '17 18:06 mitchellporter

+1

terrynguyen255 avatar Jul 23 '20 06:07 terrynguyen255