$input->requestMethod() method

Return the current request method (i.e. GET, POST, etc.) or blank if not known

Possible return values are:

  • GET
  • POST
  • HEAD
  • PUT
  • DELETE
  • OPTIONS
  • or blank if not known

Available since version 3.0.39.

Usage

// basic usage
$string = $input->requestMethod();

// usage with all arguments
$string = $input->requestMethod(string $method = '');

Arguments

NameType(s)Description
method (optional)string

Optionally enter the request method to return bool if current method matches

Return value

string bool


$input methods and properties

API reference based on ProcessWire core version 3.0.248

Latest news

  • ProcessWire Weekly #574
    The 574th issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 10 May 2025
  • New ProcessWire admin redesign
    When you upgrade to ProcessWire 3.0.248 or newer (currently the dev branch), you’ll immediately notice something new and beautiful…
    Blog / 9 May 2025
  • Subscribe to weekly ProcessWire news

I just love the easy and intuitive ProcessWire API. ProcessWire rocks!” —Jens Martsch, Web developer