httparty icon indicating copy to clipboard operation
httparty copied to clipboard

Case sensitive headers

Open radhakrishnanakireddy opened this issue 4 years ago • 3 comments

Hi, I am getting Case sensitive headers with ruby 2.6.5, Can anyone please help me with it

Thank you,

radhakrishnanakireddy avatar Jul 23 '20 12:07 radhakrishnanakireddy

Hi! Could you be more specifc, plase? What you trying to achive? What are you getting instead?

TheSmartnik avatar Jul 23 '20 13:07 TheSmartnik

Hi Please find the sample code

HTTParty.get(uri, :headers => { "Content-Type"=>"application/json", "Accept"=>"application/json", "sso_token" => "xxxxxxxxxxx" } end

When I tried the same request with curl or swagger its working, but it not working in HTTParty and as per my analysis there is something wrong with customize headers (https://stackoverflow.com/questions/42815249/how-to-preserve-custom-headers-case-in-ruby). It is happening in ruby 2.6.5,

Can anyone please help me regarding this.

Thank you

radhakrishnanakireddy avatar Jul 24 '20 07:07 radhakrishnanakireddy

this is a duplicate of #406 and not necessarily an issue with HTTParty

HTTParty uses NET::HTTP, which capitalizes request headers by default

the cleanest work around i've found https://github.com/jnunemaker/httparty/issues/406#issuecomment-1301596414

merchang avatar Nov 03 '22 03:11 merchang