Documentation

BasicHTTPClient
in package
implements HTTPClient

The HTTP part of the Amadeus API client.

Interfaces, Classes, Traits and Enums

HTTPClient

Table of Contents

$accessToken  : AccessToken|null
$configuration  : Configuration
The configuration for this API client.
$sslCertificate  : string|null
The ssl certificate for this API client.
__construct()  : mixed
execute()  : Response
Execute HTTP Request using PHP-cURL extension
getAccessToken()  : AccessToken|null
getConfiguration()  : Configuration
getSSLCertificate()  : string|null
getWithArrayParams()  : Response
A helper module for making generic getWithArrayParams requests calls.It is used by every namespaced API getWithArrayParams method.
getWithOnlyPath()  : Response
A helper module for making generic getWithOnlyPath requests calls.It is used by every namespaced API getWithOnlyPath method.
postWithStringBody()  : Response
A helper module for making generic postWithStringBody requests calls.It is used by every namespaced API postWithStringBody method.
setSSLCertificate()  : void
detectError()  : void
Detect error based on the returned status code
log()  : void
A simple log only triggered if in debug mode
setCurlOptions()  : void
Set curl options

Properties

$sslCertificate

The ssl certificate for this API client.

private string|null $sslCertificate = null

Methods

getSSLCertificate()

public getSSLCertificate() : string|null
Return values
string|null

getWithArrayParams()

A helper module for making generic getWithArrayParams requests calls.It is used by every namespaced API getWithArrayParams method.

public getWithArrayParams(string $path, array<string|int, mixed> $params) : Response

$amadeus->getAirport()->getDirectDestinations()->get( ["departureAirportCode" => "MAD", "max" => 2] );

It can be used to make any generic API call that is automatically authenticated using your API credentials:

 $this->amadeus->getClient()->getWithArrayParams(
     '/v1/airport/direct-destinations',
     ["departureAirportCode" => "MAD", "max" => 2]
 );
Parameters
$path : string
$params : array<string|int, mixed>
Tags
throws
ResponseException
Return values
Response

getWithOnlyPath()

A helper module for making generic getWithOnlyPath requests calls.It is used by every namespaced API getWithOnlyPath method.

public getWithOnlyPath(string $path) : Response

$amadeus->getShopping()->getHotelOffer("XXX")->get();

It can be used to make any generic API call that is automatically authenticated using your API credentials:

 $this->amadeus->getClient()->getWithOnlyPath("/v3/shopping/hotel-offers"."/"."XXX");
Parameters
$path : string
Tags
throws
ResponseException
Return values
Response

postWithStringBody()

A helper module for making generic postWithStringBody requests calls.It is used by every namespaced API postWithStringBody method.

public postWithStringBody(string $path, string $body[, array<string|int, mixed>|null $params = null ]) : Response

$flightOffers = $amadeus->getShopping()->getFlightOffers()->post($body);

It can be used to make any generic API call that is automatically authenticated using your API credentials:

 $amadeus->getClient()->postWithStringBody(
     '/v2/shopping/flight-offers',
     $body
 );
Parameters
$path : string
$body : string
$params : array<string|int, mixed>|null = null
Tags
throws
ResponseException
Return values
Response

setSSLCertificate()

public setSSLCertificate(string $filePath) : void
Parameters
$filePath : string
Return values
void

log()

A simple log only triggered if in debug mode

private log(string $message) : void
Parameters
$message : string
Return values
void

setCurlOptions()

Set curl options

private setCurlOptions(mixed $curlHandle, Request $request) : void
Parameters
$curlHandle : mixed
$request : Request
Return values
void

Search results