httparty
httparty copied to clipboard
Case sensitive headers
Hi, I am getting Case sensitive headers with ruby 2.6.5, Can anyone please help me with it
Thank you,
Hi! Could you be more specifc, plase? What you trying to achive? What are you getting instead?
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
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