PagesRequest::getResponseCode() method

Get response http code for this request

Returns integer, one of:

  • 0: unknown/request not yet analyzed
  • 200: successful request
  • 300: maybe redirect (needs decision)
  • 301: permanent redirect
  • 302: temporary redirect
  • 307: temporary redirect and redo using same method
  • 308: permanent redirect and redo using same method
  • 400: bad request/page path error
  • 401: unauthorized/login required
  • 403: forbidden/authenticated user lacks access
  • 404: page not found
  • 405: method not allowed
  • 414: request path too long or segment too long

Usage

$int = $pagesRequest->getResponseCode();

Return value

int


PagesRequest methods and properties

API reference based on ProcessWire core version 3.0.200

Twitter updates

  • A review of weekly core updates, plus a simple recipe for a very effective listing cache—More
    24 June 2022
  • Weekly update: Making ProcessWire render pages at old WordPress URLs (or building a simple/custom URL router in PW): More
    17 June 2022
  • New post: ProcessWire now comes with just 1 site installation profile, the "blank" profile. It makes very few assumptions, making it a minimal though excellent starting point. Here’s how you might use it— More
    10 June 2022

Latest news

  • ProcessWire Weekly #424
    In the 424th issue of ProcessWire Weekly we'll check out the latest weekly update from Ryan, introduce a new third party module, and more. Read on!
    Weekly.pw / 25 June 2022
  • Starting a site with the “blank” profile
    ProcessWire 3.0.200+ comes with just 1 site installation profile, the site-blank profile. This profile makes very few assumptions, making it a minimal though excellent starting point. Here’s how you might use it. 
    Blog / 10 June 2022
  • Subscribe to weekly ProcessWire news

“…building with ProcessWire was a breeze, I really love all the flexibility the system provides. I can’t imagine using any other CMS in the future.” —Thomas Aull