HttpTransportInterface
The two HTTP calls every OAuth 2.0 authorization-code flow makes: POST the code to the token endpoint, GET the profile with the token that comes back. It exists as a seam. Every provider in this package used to call `curl_*` inline, which meant the half of each one that matters — how a token error is told apart from a transport error, what a half-filled profile does, which field stands in when the optional one is absent — could not be exercised without talking to GitHub, Google, Apple and the rest for real.
HttpTransportInterface::post()
abstract public function post(string $url, array $fields, array $headers = []): arrayPOSTs `$fields` as `application/x-www-form-urlencoded`.
Parameters
| Name | Type | Description |
|---|---|---|
| $url | string | |
| $fields | array<string, string> | |
| $headers | list<string> | In `Name: value` form. |
Returns
`status` is 0 when the request could not be made at all.
HttpTransportInterface::get()
abstract public function get(string $url, array $headers = []): arrayGETs `$url`, typically the profile endpoint with the token in a header.
Parameters
| Name | Type | Description |
|---|---|---|
| $url | string | |
| $headers | list<string> | In `Name: value` form. |
Returns
`status` is 0 when the request could not be made at all.