pinterest-api
pinterest-api copied to clipboard
Access response http status
For proper error handling we want to rely on the http status codes which pinterest api gives back: https://developers.pinterest.com/docs/api/overview/#errors
Currently in https://github.com/realadeel/pinterest-api/blob/master/lib/pinterest/client.rb#L60 only the response body will be returned.
An example response:
[2] pry(#<Onlim::Adapter::Publish::Link::Pinterest>)> response
=> {"status"=>"failure", "code"=>3, "host"=>"devplatform-devapi-prod-f7410648", "generated_at"=>"Wed, 26 Oct 2016 09:19:28 +0000", "message"=>"Authorization failed.", "data"=>nil}
We want to rely on the documented http return status codes instead of relying on the code which is returned in the body (didn't find documentation about this code).
Are there any problems in returning the whole response?