thephpleague / oauth2-github

GitHub Provider for the OAuth 2.0 Client
MIT License
106 stars 29 forks source link

Link header #6

Closed pdewouters closed 8 years ago

pdewouters commented 8 years ago

How do I get the Link header for pagination? I tried $provider->getHeaders() that returns nothing

shadowhand commented 8 years ago

You will need to get it from the response of an API request using PSR-7 methods:

$request = $provider->getAuthenticatedRequest(...);
$response = $provider->getHttpClient()->send($request);
$link = $response->getHeader('Link');
pdewouters commented 8 years ago

So there's no methods to help with pagination in the library?

shadowhand commented 8 years ago

This package is only an OAuth2 provider. It can be used as an API helper but doesn't provide any methods to support that.