protected static function getRequestSize($header, $method)
    {
        if($method === 'GET' || $method === 'OPTIONS' || $method === 'HEAD') {
            return strlen($header) + 4;
        }
        $match = array();
        if (preg_match("/\r\nContent-Length: ?(\d+)/i", $header, $match)) {
            $content_length = isset($match[1]) ? $match[1] : 0;
            return $content_length + strlen($header) + 4;
        }
        return $method === 'DELETE' ? strlen($header) + 4 : 0;
    }
protected static function getRequestSize($header, $method)
    {
        if($method === 'GET' || $method === 'OPTIONS' || $method === 'HEAD') {
            return strlen($header) + 4;
        }
        $match = array();
        if (preg_match("/\r\nContent-Length: ?(\d+)/i", $header, $match)) {
            $content_length = isset($match[1]) ? $match[1] : 0;
            return $content_length + strlen($header) + 4;
        }
        return $method === 'DELETE' ? strlen($header) + 4 : 0;
    }
protected static function getRequestSize ( $ header , $ method ) { if ( $ method === 'GET' || $ method === 'OPTIONS' || $ method === 'HEAD' ) { return strlen ( $ header ) + 4 ; } $ match = array ( ) ; if ( preg_match ( "/\r\nContent-Length: ?(\d+)/i" , $ header , $ match ) ) { $ content_length = isset ( $ match [ 1 ] ) ? $ match [ 1 ] : 0 ; return $ content_length + strlen ( $ header ) + 4 ; } return $ method === 'DELETE' ? strlen ( $ header ) + 4 : 0 ; }
Get whole size of the request
includes the request headers and request body.
@param string $header The request headers
@param string $method The request method
@return integer
Get whole size of the request includes the request headers and request body .