WireHttp::statusText() method

Send to a URL using HEAD and return the status code and text like "200 OK"

Usage

// basic usage
$string = $http->statusText(string $url);

// usage with all arguments
$string = $http->statusText(string $url, mixed $data = [], array $options = []);

Arguments

NameType(s)Description
urlstring

URL to request (including http:// or https://)

data (optional)mixed

Array of data to send (if not already set before) or raw data

options (optional)array

Optional options to modify default behavior, see the send() method for details.

Return value

string

String of status code + text on success. Example: "200 OK', "302 Found", "404 Not Found"

See Also


$http methods and properties

API reference based on ProcessWire core version 3.0.244

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits