You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the really late response on this. Something feels wrong about adding the headers in to this particular helper and tacking them on to the supposed body.
Two changes come to mind off the top of my head that could be implemented here to give you access to the headers:
We could do away with this helper generally and instead return either the full response object or an instance of Foursquare2::APIError. This has the downside of requiring more traversal of the response object for the integrator but gives complete transparency in to the response returned (unless it is not a 200)
We could return a hash that includes a formatted_body (the equivalent of the current response_body) as well as a raw_response (the complete raw response data). This would still allow for less traversal as the current method does but also give access to the full raw response for usecases like this one.
What do you think? I'm happy to help tag team this with you.
0c8e1b8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the really late response on this. Something feels wrong about adding the headers in to this particular helper and tacking them on to the supposed body.
Two changes come to mind off the top of my head that could be implemented here to give you access to the headers:
response
object or an instance ofFoursquare2::APIError
. This has the downside of requiring more traversal of theresponse
object for the integrator but gives complete transparency in to the response returned (unless it is not a200
)formatted_body
(the equivalent of the currentresponse_body
) as well as araw_response
(the complete raw response data). This would still allow for less traversal as the current method does but also give access to the full raw response for usecases like this one.What do you think? I'm happy to help tag team this with you.