facebook-sdk
facebook-sdk copied to clipboard
Add x-app-usage response headers to result
Add x-app-usage response headers to GraphAPI request result Facebook API returns x-app-usage header which contains json with percentage usage of the api for various metrics. It would be handy to have access to that data when using this facebook-sdk. My simple pr just checks for the header in fb api response and adds it to the result returned by GraphAPI instance if available.
FB docs: https://developers.facebook.com/docs/graph-api/advanced/rate-limiting It was also reported here: https://github.com/mobolic/facebook-sdk/issues/314
I've also made changes to the CircleCI configuration so that the automated tests won't automatically fail.
I can add some tests, but I can see the tests are running on the actual FB API. Wouldn't it be better to run them on a mocked version of it or use something like pyvcr? Now I can reach my app's limits just by running the tests.
Would it make more sense to just return all headers? This would negate the need to add more code if Facebook adds more useful headers (e.g. X-Page-Usage, etc.).