WordPress\AiClient\Providers\Http\DTO
ApiKeyRequestAuthentication::authenticateRequest
{@inheritDoc}
Method of the class: ApiKeyRequestAuthentication{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ApiKeyRequestAuthentication = new ApiKeyRequestAuthentication(); $ApiKeyRequestAuthentication->authenticateRequest( $request ): \WordPress\AiClient\Providers\Http\DTO\Request;
- $request([WordPress\AiClient\Providers\Http\DTO\Request]()) (required)
- .
Changelog
| Since 0.1.0 | Introduced. |
ApiKeyRequestAuthentication::authenticateRequest() ApiKeyRequestAuthentication::authenticateRequest code WP 7.0
public function authenticateRequest(\WordPress\AiClient\Providers\Http\DTO\Request $request): \WordPress\AiClient\Providers\Http\DTO\Request
{
// Add the API key to the request headers.
return $request->withHeader('Authorization', 'Bearer ' . $this->apiKey);
}