Menu

## CurlHTTPClient
in package
implements HTTPClient

CurlHTTPClient.php : 33

Class CurlHTTPClient.

A HTTPClient that uses cURL.

### Interfaces, Classes and Traits

HTTPClient
  The interface that represents HTTP client of LINE Messaging API.

### Table of Contents

$authHeaders : array<string|int, mixed>
$connectTimeout : int|null
$timeout : int|null
$userAgentHeader : array<string|int, mixed>
__construct() : mixed
  CurlHTTPClient constructor.
delete() : Response
  Sends DELETE request to LINE Messaging API.
get() : Response
  Sends GET request to LINE Messaging API.
post() : Response
  Sends POST request to LINE Messaging API.
put() : Response
  Sends PUT request to LINE Messaging API.
setConnectTimeout() : mixed
  set curl connect timeout second
setTimeout() : mixed
  set curl timeout second
getOptions() : array<string|int, mixed>
sendRequest() : Response

### Properties

#### $authHeaders

CurlHTTPClient.php : 36
`private array<string|int, mixed> $authHeaders`

#### $connectTimeout

CurlHTTPClient.php : 42
`private int|null $connectTimeout`

#### $timeout

CurlHTTPClient.php : 40
`private int|null $timeout`

#### $userAgentHeader

CurlHTTPClient.php : 38
`private array<string|int, mixed> $userAgentHeader`

### Methods

#### __construct()

CurlHTTPClient.php : 49

CurlHTTPClient constructor.

`public __construct(string $channelToken) : mixed`

##### Parameters

$channelToken : string

  Access token of your channel.

##### Return values

mixed —

#### delete()

CurlHTTPClient.php : 112

Sends DELETE request to LINE Messaging API.

`public delete(string $url) : Response`

##### Parameters

$url : string

  Request URL.

##### Tags

throws
  CurlExecutionException

##### Return values

Response —

Response of API request.

#### get()

CurlHTTPClient.php : 68

Sends GET request to LINE Messaging API.

`public get(string $url[, array<string|int, mixed> $data = [] ][, array<string|int, mixed> $headers = [] ]) : Response`

##### Parameters

$url : string

  Request URL.

$data : array<string|int, mixed> = []

  Request body

$headers : array<string|int, mixed> = []

  Request headers.

##### Tags

throws
  CurlExecutionException

##### Return values

Response —

Response of API request.

#### post()

CurlHTTPClient.php : 85

Sends POST request to LINE Messaging API.

`public post(string $url, array<string|int, mixed> $data[, array<string|int, mixed>|null $headers = null ]) : Response`

##### Parameters

$url : string

  Request URL.

$data : array<string|int, mixed>

  Request body or resource path.

$headers : array<string|int, mixed>|null = null

  Request headers.

##### Tags

throws
  CurlExecutionException

##### Return values

Response —

Response of API request.

#### put()

CurlHTTPClient.php : 99

Sends PUT request to LINE Messaging API.

`public put(string $url, array<string|int, mixed> $data[, array<string|int, mixed>|null $headers = null ]) : Response`

##### Parameters

$url : string

  Request URL.

$data : array<string|int, mixed>

  Request body.

$headers : array<string|int, mixed>|null = null

  Request headers.

##### Return values

Response —

Response of API request.

#### setConnectTimeout()

CurlHTTPClient.php : 132

set curl connect timeout second

`public setConnectTimeout(int|null $connectTimeout) : mixed`

##### Parameters

$connectTimeout : int|null

  connectTimeout(sec)

##### Return values

mixed —

#### setTimeout()

CurlHTTPClient.php : 122

set curl timeout second

`public setTimeout(int|null $timeout) : mixed`

##### Parameters

$timeout : int|null

  timeout(sec)

##### Return values

mixed —

#### getOptions()

CurlHTTPClient.php : 143
`private getOptions(string $method, array<string|int, mixed> $headers, array<string|int, mixed>|string|null $reqBody) : array<string|int, mixed>`

##### Parameters

$method : string
$headers : array<string|int, mixed>
$reqBody : array<string|int, mixed>|string|null

##### Return values

array<string|int, mixed> —

cUrl options

#### sendRequest()

CurlHTTPClient.php : 202
`private sendRequest(string $method, string $url, array<string|int, mixed> $additionalHeader[, string|array<string|int, mixed>|null $reqBody = null ]) : Response`

##### Parameters

$method : string
$url : string
$additionalHeader : array<string|int, mixed>
$reqBody : string|array<string|int, mixed>|null = null

##### Tags

throws
  CurlExecutionException

##### Return values

Response —

## Search results