AbstractHttp
in package
implements
HttpInterface
Abstract HTTP class
Tags
Table of Contents
Interfaces
- HttpInterface
- HTTP interface
Properties
- $request : AbstractRequest|null
- Request
- $response : AbstractResponse|null
- Response
Methods
- __construct() : mixed
- Instantiate the HTTP object
- __toString() : string
- Render the request/response to string
- getRequest() : AbstractRequest
- Get the request
- getResponse() : AbstractResponse
- Get the response
- hasRequest() : bool
- Has request
- hasResponse() : bool
- Get the response
- isAccepted() : bool|null
- Determine if the response is 202 accepted
- isBadGateway() : bool|null
- Determine if the response is a 502 Bad Gateway
- isBadRequest() : bool|null
- Determine if the response is a 400 Bad Request
- isClientError() : bool|null
- Determine if the response is a client error
- isComplete() : bool
- Determine if the response is complete
- isConflict() : bool|null
- Determine if the response is a 409 Conflict
- isContinue() : bool|null
- Determine if the response is a continue
- isCreated() : bool|null
- Determine if the response is 201 created
- isError() : bool|null
- Determine if the response is an error
- isForbidden() : bool|null
- Determine if the response is a 403 Forbidden
- isFound() : bool|null
- Determine if the response is a 302 Found
- isInternalServerError() : bool|null
- Determine if the response is a 500 Internal Server Error
- isLengthRequired() : bool|null
- Determine if the response is a 411 Length Required
- isMethodNotAllowed() : bool|null
- Determine if the response is a 405 Method Not Allowed
- isMovedPermanently() : bool|null
- Determine if the response is a 301 Moved Permanently
- isNoContent() : bool|null
- Determine if the response is 204 No Content
- isNotAcceptable() : bool|null
- Determine if the response is a 406 Not Acceptable
- isNotFound() : bool|null
- Determine if the response is a 404 Not Found
- isOk() : bool|null
- Determine if the response is 200 OK
- isRedirect() : bool|null
- Determine if the response is a redirect
- isRequestTimeout() : bool|null
- Determine if the response is a 408 Request Timeout
- isServerError() : bool|null
- Determine if the response is a server error
- isServiceUnavailable() : bool|null
- Determine if the response is a 503 Service Unavailable
- isSuccess() : bool|null
- Determine if the response is a success
- isTooManyRequests() : bool|null
- Determine if the response is a 429 Too Many Requests
- isUnauthorized() : bool|null
- Determine if the response is a 401 Unauthorized
- isUnprocessableEntity() : bool|null
- Determine if the response is a 422 Unprocessable Entity
- isUnsupportedMediaType() : bool|null
- Determine if the response is a 415 Unsupported Media Type
- render() : string
- Render the request/response to string
- send() : mixed
- Send the request/response
- setRequest() : AbstractHttp
- Set the request
- setResponse() : AbstractHttp
- Set the response
Properties
$request
Request
protected
AbstractRequest|null
$request
= null
$response
Response
protected
AbstractResponse|null
$response
= null
Methods
__construct()
Instantiate the HTTP object
public
__construct([AbstractRequest|null $request = null ][, AbstractResponse|null $response = null ]) : mixed
Parameters
- $request : AbstractRequest|null = null
- $response : AbstractResponse|null = null
__toString()
Render the request/response to string
public
abstract __toString() : string
Return values
stringgetRequest()
Get the request
public
getRequest() : AbstractRequest
Return values
AbstractRequestgetResponse()
Get the response
public
getResponse() : AbstractResponse
Return values
AbstractResponsehasRequest()
Has request
public
hasRequest() : bool
Return values
boolhasResponse()
Get the response
public
hasResponse() : bool
Return values
boolisAccepted()
Determine if the response is 202 accepted
public
isAccepted() : bool|null
Return values
bool|nullisBadGateway()
Determine if the response is a 502 Bad Gateway
public
isBadGateway() : bool|null
Return values
bool|nullisBadRequest()
Determine if the response is a 400 Bad Request
public
isBadRequest() : bool|null
Return values
bool|nullisClientError()
Determine if the response is a client error
public
isClientError() : bool|null
Return values
bool|nullisComplete()
Determine if the response is complete
public
isComplete() : bool
Return values
boolisConflict()
Determine if the response is a 409 Conflict
public
isConflict() : bool|null
Return values
bool|nullisContinue()
Determine if the response is a continue
public
isContinue() : bool|null
Return values
bool|nullisCreated()
Determine if the response is 201 created
public
isCreated() : bool|null
Return values
bool|nullisError()
Determine if the response is an error
public
isError() : bool|null
Return values
bool|nullisForbidden()
Determine if the response is a 403 Forbidden
public
isForbidden() : bool|null
Return values
bool|nullisFound()
Determine if the response is a 302 Found
public
isFound() : bool|null
Return values
bool|nullisInternalServerError()
Determine if the response is a 500 Internal Server Error
public
isInternalServerError() : bool|null
Return values
bool|nullisLengthRequired()
Determine if the response is a 411 Length Required
public
isLengthRequired() : bool|null
Return values
bool|nullisMethodNotAllowed()
Determine if the response is a 405 Method Not Allowed
public
isMethodNotAllowed() : bool|null
Return values
bool|nullisMovedPermanently()
Determine if the response is a 301 Moved Permanently
public
isMovedPermanently() : bool|null
Return values
bool|nullisNoContent()
Determine if the response is 204 No Content
public
isNoContent() : bool|null
Return values
bool|nullisNotAcceptable()
Determine if the response is a 406 Not Acceptable
public
isNotAcceptable() : bool|null
Return values
bool|nullisNotFound()
Determine if the response is a 404 Not Found
public
isNotFound() : bool|null
Return values
bool|nullisOk()
Determine if the response is 200 OK
public
isOk() : bool|null
Return values
bool|nullisRedirect()
Determine if the response is a redirect
public
isRedirect() : bool|null
Return values
bool|nullisRequestTimeout()
Determine if the response is a 408 Request Timeout
public
isRequestTimeout() : bool|null
Return values
bool|nullisServerError()
Determine if the response is a server error
public
isServerError() : bool|null
Return values
bool|nullisServiceUnavailable()
Determine if the response is a 503 Service Unavailable
public
isServiceUnavailable() : bool|null
Return values
bool|nullisSuccess()
Determine if the response is a success
public
isSuccess() : bool|null
Return values
bool|nullisTooManyRequests()
Determine if the response is a 429 Too Many Requests
public
isTooManyRequests() : bool|null
Return values
bool|nullisUnauthorized()
Determine if the response is a 401 Unauthorized
public
isUnauthorized() : bool|null
Return values
bool|nullisUnprocessableEntity()
Determine if the response is a 422 Unprocessable Entity
public
isUnprocessableEntity() : bool|null
Return values
bool|nullisUnsupportedMediaType()
Determine if the response is a 415 Unsupported Media Type
public
isUnsupportedMediaType() : bool|null
Return values
bool|nullrender()
Render the request/response to string
public
abstract render() : string
Return values
stringsend()
Send the request/response
public
abstract send() : mixed
setRequest()
Set the request
public
setRequest(AbstractRequest $request) : AbstractHttp
Parameters
- $request : AbstractRequest
Return values
AbstractHttpsetResponse()
Set the response
public
setResponse(AbstractResponse $response) : AbstractHttp
Parameters
- $response : AbstractResponse