Detailed Description
Simple utilities for http requests.
- Author
- Dodonov A.A.
Definition at line 26 of file http.php.
Member Function Documentation
| fetch_request_body |
( |
|
$RequestData | ) |
|
Getting request body.
- Parameters
-
| $RequestData | - Received data. |
- Returns
- Request body.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 287 of file http.php.
{
try
{
$RequestParts = explode( "\r\n\r\n" , $RequestData );
$Start = strpos( $RequestParts[ 1 ] , "\r\n" );
return( substr( $RequestParts[ 1 ] , $Start + 2 ) );
}
catch( Exception $e )
{
}
}
| fetch_request_header |
( |
|
$RequestData | ) |
|
Getting headers.
- Parameters
-
| $RequestData | - Received data. |
- Returns
- Header.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 251 of file http.php.
{
try
{
$RequestParts = explode( "\r\n\r\n" , $RequestData );
return( $RequestParts[ 0 ] );
}
catch( Exception $e )
{
}
}
| http_request |
( |
|
$Data = '' | ) |
|
Sending requests.
- Parameters
-
- Returns
- Server responce.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 157 of file http.php.
{
try
{
$Curl = $this->default_init( $Data );
$RequestData = curl_exec( $Curl );
if( curl_errno( $Curl ) )
{
throw( new Exception( curl_error( $Curl ) ) );
}
curl_close( $Curl );
return( $RequestData );
}
catch( Exception $e )
{
}
}
| https_request |
( |
|
$Data = '' | ) |
|
Sending requests.
- Parameters
-
- Returns
- Server responce.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 202 of file http.php.
{
try
{
$Curl = $this->default_init( $Data );
curl_setopt( $Curl , CURLOPT_SSLVERSION , 3 );
curl_setopt( $Curl , CURLOPT_SSL_VERIFYPEER , false );
curl_setopt( $Curl , CURLOPT_SSL_VERIFYHOST , 2 );
$RequestData = curl_exec( $Curl );
if( curl_errno( $Curl ) )
{
throw( new Exception( curl_error( $Curl ) ) );
}
curl_close( $Curl );
return( $RequestData );
}
catch( Exception $e )
{
}
}
| set |
( |
|
$FieldName, |
|
|
|
$FieldValue |
|
) |
| |
Function sets field.
- Parameters
-
| $FieldName | - Field name. |
| $FieldValue | - Field value. |
- Author
- Dodonov A.A.
Definition at line 46 of file http.php.
{
$this->$FieldName = $FieldValue;
}
Field Documentation
Host.
- Author
- Dodonov A.A.
Definition at line 61 of file http.php.
Request type.
- Author
- Dodonov A.A.
Definition at line 85 of file http.php.
URL.
- Author
- Dodonov A.A.
Definition at line 73 of file http.php.
The documentation for this class was generated from the following file: