src/AirtableClient.php
/**
     * Use the HttpClient to request Airtable API and returns the response.
     */
Use the HttpClient to request Airtable API and returns the response.
Use the HttpClient to request Airtable API and returns the response .
private function request(string $method, string $url, ?array $body = null): ResponseInterface
    {
        $params = ['auth_bearer' => $this->key];
        if ('POST' === $method) {
            $params = $params + ['headers' => ['Content-Type' => 'application/json']];
            $params = $params + ['json' => ['fields' => $body]];
        }
        return $this->httpClient->request(
            $method,
            'https://api.airtable.com/v0/'.$url,
            $params
        );
    }
private function request ( string $ method , string $ url , ? array $ body = null ) : ResponseInterface { $ params = [ 'auth_bearer' => $ this -> key ] ; if ( 'POST' === $ method ) { $ params = $ params + [ 'headers' => [ 'Content-Type' => 'application/json' ] ] ; $ params = $ params + [ 'json' => [ 'fields' => $ body ] ] ; } return $ this -> httpClient -> request ( $ method , 'https://api.airtable.com/v0/' . $ url , $ params ) ; }
Use the HttpClient to request Airtable API and returns the response.
Use the HttpClient to request Airtable API and returns the response .