Api
in package
Table of Contents
Constants
- ACCEPT_CONTENTS = ["json", "form"]
Properties
Methods
- __construct() : mixed
- executeCurl() : string
- getErrorNo() : int
- getUrl() : string
- Get the value of url
- request() : array<string|int, mixed>
- connect() : array<string|int, mixed>
- requestFormData() : string
- requestJson() : string
- setUrl() : string
- validateParams() : void
Constants
ACCEPT_CONTENTS
public
mixed
ACCEPT_CONTENTS
= ["json", "form"]
Properties
$timeout
private
mixed
$timeout
= 60
$url
private
mixed
$url
Methods
__construct()
public
__construct(string $url[, int $timeout = 60 ]) : mixed
Parameters
- $url : string
-
Autentique API URL
- $timeout : int = 60
executeCurl()
public
executeCurl(CurlHandle $curl) : string
Parameters
- $curl : CurlHandle
Return values
stringgetErrorNo()
public
getErrorNo(CurlHandle $curl) : int
Parameters
- $curl : CurlHandle
Return values
intgetUrl()
Get the value of url
public
getUrl() : string
Tags
Return values
stringrequest()
public
request(string $token, string $query, string $contentType[, string|null $pathFile = null ]) : array<string|int, mixed>
Parameters
- $token : string
- $query : string
- $contentType : string
-
json|form
- $pathFile : string|null = null
Return values
array<string|int, mixed>connect()
private
connect(array<string|int, mixed> $httpHeader, string|array<string|int, mixed> $fields) : array<string|int, mixed>
Parameters
- $httpHeader : array<string|int, mixed>
- $fields : string|array<string|int, mixed>
Return values
array<string|int, mixed> —$response
requestFormData()
private
requestFormData() : string
Return values
stringrequestJson()
private
requestJson() : string
Return values
stringsetUrl()
private
setUrl(string $url) : string
Parameters
- $url : string
Return values
stringvalidateParams()
private
validateParams(string $contentType, string $query) : void
Parameters
- $contentType : string
- $query : string