Contentserv PHP API

CSHttpHeadRequest extends CSHttpRequest
in package

Class to generate and send HEAD requests

Tags
since

CS17.0

Table of Contents

METHOD_DELETE  = 'delete'
METHOD_GET  = 'get'
Constants holding the request methods.
METHOD_HEAD  = 'head'
METHOD_OPTIONS  = 'options'
METHOD_POST  = 'post'
METHOD_PUT  = 'put'
addCookie()  : void
Adds a cookie parameter to the request.
addCookies()  : void
Adds the cookies values to the request.
addHeader()  : void
Adds a header to the request.
addParameter()  : void
Adds a request parameter to the request. Those parameters are appended to the URL as GET parameter.
create()  : CSHttpGetRequest|CSHttpPostRequest|CSHttpPutRequest|CSHttpDeleteRequest|CSHttpHeadRequest|CSHttpOptionsRequest
Creates a http request object that can be used to configre and send a request to a particular url.
getCookies()  : string
Get the cookies of the request
getHeaders()  : string
Get the headers of the request
getParameters()  : array<string|int, mixed>
Gets the parameters of the url
getPassword()  : string
Get the password of the request
getTimeout()  : string
Get the timeout of the request
getUrl()  : string
Get the url of the request
getUser()  : string
Get the user of the request
send()  : CSHttpResponse
Abstract method that requires to implement the send-logic of a concrete request type.
setPassword()  : void
Sets the password to be used with the request.
setUser()  : void
Sets the user to be used with the request.

Constants

METHOD_GET

Constants holding the request methods.

public mixed METHOD_GET = 'get'
Tags

Methods

addCookie()

Adds a cookie parameter to the request.

public final addCookie(string $sKey, string $sValue) : void
Parameters
$sKey : string

The name of the cookie to add.

$sValue : string

The value of the cookie to add.

Tags
access

public

Return values
void

addCookies()

Adds the cookies values to the request.

public final addCookies(array<string|int, mixed> $aCookieValues) : void
Parameters
$aCookieValues : array<string|int, mixed>

The array with the cookie values to add.

Tags
access

public

Return values
void

addHeader()

Adds a header to the request.

public final addHeader(string $sKey, string $sValue) : void
Parameters
$sKey : string

The name of the header to add.

$sValue : string

The value of the header to add.

Tags
access

public

Return values
void

addParameter()

Adds a request parameter to the request. Those parameters are appended to the URL as GET parameter.

public final addParameter(string $sName, string $sValue) : void
Parameters
$sName : string

The name of the parameter to add.

$sValue : string

The value of the parameter to add.

Tags
access

public

Return values
void

create()

Creates a http request object that can be used to configre and send a request to a particular url.

public final static create(string $sUrl[, string $sMethod = self::METHOD_GET ][, int $iTimeout = 30 ]) : CSHttpGetRequest|CSHttpPostRequest|CSHttpPutRequest|CSHttpDeleteRequest|CSHttpHeadRequest|CSHttpOptionsRequest
Parameters
$sUrl : string

The url the request should be sent to.

$sMethod : string = self::METHOD_GET

The http method to use as one of the METHOD_*-constants.

$iTimeout : int = 30

The request timeout.

Tags
throws
CSHttpException

if http method is not supported

access

public

Return values
CSHttpGetRequest|CSHttpPostRequest|CSHttpPutRequest|CSHttpDeleteRequest|CSHttpHeadRequest|CSHttpOptionsRequest

The concrete request object based on the http method used.

getCookies()

Get the cookies of the request

public final getCookies() : string
Tags
Return values
string

getHeaders()

Get the headers of the request

public final getHeaders() : string
Tags
Return values
string

getParameters()

Gets the parameters of the url

public final getParameters() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

getPassword()

Get the password of the request

public final getPassword() : string
Tags
Return values
string

getTimeout()

Get the timeout of the request

public final getTimeout() : string
Tags
Return values
string

getUrl()

Get the url of the request

public final getUrl() : string
Tags
Return values
string

getUser()

Get the user of the request

public final getUser() : string
Tags
Return values
string

send()

Abstract method that requires to implement the send-logic of a concrete request type.

public send() : CSHttpResponse
Tags
inheritdoc
Return values
CSHttpResponse

The response object of the finished request.

setPassword()

Sets the password to be used with the request.

public final setPassword(string $sPassword) : void
Parameters
$sPassword : string

The password to be sent with the request.

Tags
access

public

Return values
void

setUser()

Sets the user to be used with the request.

public final setUser(string $sUser) : void
Parameters
$sUser : string

The user name to be sent with the request.

Tags
access

public

Return values
void

        

Search results