Documentation

ClientInterface
in

HTTP client interface

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
4.1.0

Table of Contents

addRequestHeader()  : ClientInterface
Add request header
addRequestHeaders()  : ClientInterface
Add request headers
addResponseHeader()  : ClientInterface
Add response header
addResponseHeaders()  : ClientInterface
Add response headers
createMultipartForm()  : ClientInterface
Create request as a multipart form
createUrlEncodedForm()  : ClientInterface
Create request as a URL-encoded form
getField()  : mixed
Get a field
getFields()  : array<string|int, mixed>
Get all field
getMethod()  : string
Get the method
getRequest()  : Request
Get the request object
getRequestBody()  : string
Get the request body
getRequestHeader()  : mixed
Get the request header
getRequestHeaders()  : array<string|int, mixed>
Get the request headers
getResource()  : resource
Get the resource
getResponse()  : Response
Get the response object
getResponseBody()  : string
Get the response body
getResponseCode()  : string
Get the response code
getResponseHeader()  : mixed
Get the response header
getResponseHeaders()  : array<string|int, mixed>
Get the response headers
getUrl()  : string
Get the URL
hasRequest()  : bool
Has request object
hasRequestHeader()  : bool
Has request header
hasRequestHeaders()  : bool
Has request headers
hasResource()  : bool
Determine whether or not resource is available
hasResponse()  : bool
Has response object
hasResponseHeader()  : bool
Has response header
hasResponseHeaders()  : bool
Has response headers
isMultipartForm()  : bool
Check if request is a multipart form
isUrlEncodedForm()  : bool
Check if request is a URL-encoded form
open()  : ClientInterface
Create and open the client resource
removeField()  : ClientInterface
Remove a field
removeFields()  : ClientInterface
Remove all fields
request()  : Request
Get the request object (alias method)
resource()  : resource
Get the resource (alias method)
response()  : Response
Get the response object (alias method)
send()  : void
Method to send the request and get the response
setField()  : ClientInterface
Set a field
setFields()  : ClientInterface
Set all fields
setMethod()  : ClientInterface
Set the method
setRequest()  : ClientInterface
Set the request object
setResponse()  : ClientInterface
Set the response object
setUrl()  : ClientInterface
Set the URL
throwError()  : void
Throw an exception upon an error.

Methods

getField()

Get a field

public getField(string $name) : mixed
Parameters
$name : string
Return values
mixed

getFields()

Get all field

public getFields() : array<string|int, mixed>
Return values
array<string|int, mixed>

getMethod()

Get the method

public getMethod() : string
Return values
string

getRequestBody()

Get the request body

public getRequestBody() : string
Return values
string

getRequestHeader()

Get the request header

public getRequestHeader(string $name) : mixed
Parameters
$name : string
Return values
mixed

getRequestHeaders()

Get the request headers

public getRequestHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>

getResource()

Get the resource

public getResource() : resource
Return values
resource

getResponseBody()

Get the response body

public getResponseBody() : string
Return values
string

getResponseCode()

Get the response code

public getResponseCode() : string
Return values
string

getResponseHeader()

Get the response header

public getResponseHeader(string $name) : mixed
Parameters
$name : string
Return values
mixed

getResponseHeaders()

Get the response headers

public getResponseHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>

getUrl()

Get the URL

public getUrl() : string
Return values
string

hasRequest()

Has request object

public hasRequest() : bool
Return values
bool

hasRequestHeader()

Has request header

public hasRequestHeader(string $name) : bool
Parameters
$name : string
Return values
bool

hasRequestHeaders()

Has request headers

public hasRequestHeaders() : bool
Return values
bool

hasResource()

Determine whether or not resource is available

public hasResource() : bool
Return values
bool

hasResponse()

Has response object

public hasResponse() : bool
Return values
bool

hasResponseHeader()

Has response header

public hasResponseHeader(string $name) : bool
Parameters
$name : string
Return values
bool

hasResponseHeaders()

Has response headers

public hasResponseHeaders() : bool
Return values
bool

isMultipartForm()

Check if request is a multipart form

public isMultipartForm() : bool
Return values
bool

isUrlEncodedForm()

Check if request is a URL-encoded form

public isUrlEncodedForm() : bool
Return values
bool

resource()

Get the resource (alias method)

public resource() : resource
Return values
resource

send()

Method to send the request and get the response

public send() : void
Return values
void

throwError()

Throw an exception upon an error.

public throwError(string $error) : void
Parameters
$error : string
Tags
throws
Exception
Return values
void

Search results