Sends an HTTP request using the specified transport method.
public static sendHttpRequestBy ( string $method = 'socket', string $aUrl, integer $timeout, string $userAgent = null, string $destinationPath = null, resource $file = null, integer $followDepth, boolean | string $acceptLanguage = false, boolean $acceptInvalidSslCertificate = false, array | boolean $byteRange = false, boolean $getExtendedInfo = false, string $httpMethod = 'GET', string $httpUsername = null, string $httpPassword = null, array | string $requestBody = null ) : boolean | ||
$method | string | |
$aUrl | string | |
$timeout | integer | in seconds |
$userAgent | string | |
$destinationPath | string | |
$file | resource | |
$followDepth | integer | |
$acceptLanguage | boolean | string | Accept-language header |
$acceptInvalidSslCertificate | boolean | Only used with $method == 'curl'. If set to true (NOT recommended!) the SSL certificate will not be checked |
$byteRange | array | boolean | For Range: header. Should be two element array of bytes, eg, array(0, 1024) Doesn't work w/ fopen method. |
$getExtendedInfo | boolean | True to return status code, headers & response, false if just response. |
$httpMethod | string | The HTTP method to use. Defaults to `'GET'`. |
$httpUsername | string | HTTP Auth username |
$httpPassword | string | HTTP Auth password |
$requestBody | array | string | If $httpMethod is 'POST' this may accept an array of variables or a string that needs to be posted |
Résultat | boolean | true (or string/array) on success; false on HTTP response error code (1xx or 4xx) |