jnunemaker / httparty

:tada: Makes http fun again!
MIT License
5.79k stars 968 forks source link

Add application/problem+json to the supported formats #758

Closed nortonbatista closed 2 years ago

nortonbatista commented 2 years ago

Good evening!

I was using an API and the endpoint returned "application/problem+json" in the Content-Type. I had to create a custom parser just to make HTTParty parse the response from the API.

Can you guys add this content type in the SupportedFormats?

My custom parser:

class CustomParser < HTTParty::Parser
  SupportedFormats.merge!(
    { 'application/problem+json' => :json }
  )
end
jnunemaker commented 2 years ago

We aren't going to add custom content types, but creating your own parser or manually adding format: :json seems right.