vznet/oauth_2.0_client_php

suggestion: allow user headers pass in to callApiEndpoint()

Closed this issue · 3 comments

Currently, a $header is set in this function. There is no way to modified this except hardcode it in code. Maybe there should be a $extra_headers passed into this function and append to $header.

The application for it is for when an API requires custom headers. In my case, YT API requires Content-Type, GData-Version, X-GData-Key set.

second thought... maybe this header should pass in from the OAuth2_Service_Configuration constructor??

Since passing additional headers to an API call is in most cases more call than provider specific, I added this as a parameter to the callApiEndpoint method.

works for me. thx