Documentation

Parser
in package

HTTP response parser class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

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

license

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

version
5.2.0

Table of Contents

Constants

BASE64  = 'BASE64'
Encoding constants
DEFLATE  = 'DEFLATE'
GZIP  = 'GZIP'
QUOTED  = 'QUOTED'
RAW_URL  = 'RAW_URL'
URL  = 'URL'

Methods

decodeChunkedData()  : string
Decode a chunked transfer-encoded data and return the decoded data
decodeData()  : string
Decode data
encodeData()  : string
Encode data
parseDataByContentType()  : mixed
Parse request or response data based on content type
parseHeaders()  : array<string|int, mixed>
Parse headers
parseResponseFromString()  : Response
Parse a response from a full response string
parseResponseFromUri()  : Response
Parse a response from a URI

Constants

BASE64

Encoding constants

public string BASE64 = 'BASE64'

DEFLATE

public mixed DEFLATE = 'DEFLATE'

QUOTED

public mixed QUOTED = 'QUOTED'

RAW_URL

public mixed RAW_URL = 'RAW_URL'

Methods

decodeChunkedData()

Decode a chunked transfer-encoded data and return the decoded data

public static decodeChunkedData(string $data) : string
Parameters
$data : string
Return values
string

decodeData()

Decode data

public static decodeData(string $data[, string|null $encoding = null ][, bool $chunked = false ]) : string
Parameters
$data : string
$encoding : string|null = null
$chunked : bool = false
Return values
string

encodeData()

Encode data

public static encodeData(string $data[, string|null $encoding = null ]) : string
Parameters
$data : string
$encoding : string|null = null
Return values
string

parseDataByContentType()

Parse request or response data based on content type

public static parseDataByContentType(string $rawData[, string|null $contentType = null ][, string|null $encoding = null ][, bool $chunked = false ]) : mixed
Parameters
$rawData : string
$contentType : string|null = null
$encoding : string|null = null
$chunked : bool = false

parseHeaders()

Parse headers

public static parseHeaders(mixed $headers) : array<string|int, mixed>
Parameters
$headers : mixed
Return values
array<string|int, mixed>

parseResponseFromString()

Parse a response from a full response string

public static parseResponseFromString(string $responseString) : Response
Parameters
$responseString : string
Return values
Response

parseResponseFromUri()

Parse a response from a URI

public static parseResponseFromUri(string $uri[, string $method = 'GET' ][, string $mode = 'r' ][, array<string|int, mixed> $options = [] ][, array<string|int, mixed> $params = [] ]) : Response
Parameters
$uri : string
$method : string = 'GET'
$mode : string = 'r'
$options : array<string|int, mixed> = []
$params : array<string|int, mixed> = []
Tags
throws
Exception|Exception
Return values
Response

        
On this page

Search results