r::body PHP Method

body() static public method

Returns the request body from POST requests for example
static public body ( ) : array
return array
    static function body()
    {
        @parse_str(@file_get_contents('php://input'), $body);
        return self::sanitize((array) $body);
    }

Usage Example

示例#1
0
 public function testBody()
 {
     $this->assertEquals('', r::body());
 }