WireHttp::status() method

Send to a URL using a HEAD request and return the status code

Usage

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

// usage with all arguments
$int = $http->status(string $url, mixed $data = [], bool $textMode = false, 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

textMode (optional)bool

When true function will return a string rather than integer, see the statusText() method.

options (optional)array

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

Return value

int string

Integer or string of status code (200, 404, etc.)

See Also


$http methods and properties

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #532
    In the 532nd issue of ProcessWire Weekly we'll cover the latest core updates, check out a couple of brand-new third party modules, and more. Read on!
    Weekly.pw / 20 July 2024
  • Page List Custom Children module
    This simple module gives you the ability to customize the parent/child relationship as it appears in the admin page list, enabling child pages to appear under more than one parent.
    Blog / 28 June 2024
  • Subscribe to weekly ProcessWire news

“The end client and designer love the ease at which they can update the website. Training beyond how to log in wasn’t even necessary since ProcessWire’s default interface is straightforward.” —Jonathan Lahijani