Zaphpa_Router::getRequestMethod PHP Method

getRequestMethod() public static method

Get lower-cased representation of current HTTP Request method
public static getRequestMethod ( )
    public static function getRequestMethod()
    {
        return strtolower($_SERVER['REQUEST_METHOD']);
    }

Usage Example

Beispiel #1
0
 function preroute(&$req, &$res)
 {
     header("Access-Control-Allow-Origin: {$this->domain}", true);
     if (strcasecmp(Zaphpa_Router::getRequestMethod(), "options") == 0) {
         header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, PATCH", true);
         header("Access-Control-Allow-Headers: origin, x-http-method-override, accept, content-type, authorization", true);
     }
 }
All Usage Examples Of Zaphpa_Router::getRequestMethod