Request
The request object can be accessed in your router handler.
Context Info
Swoole Request
Get Parameter
Post Parameter
File Parameter
Request Parameter(Get、Post、File parameter)
All Request Parameters
Header
Server Environment Variable
Request Method
Request URI
Query String
HTTP Body
Example
// Fetch Swoole Request
$this->getRequest()->getSwRequest();
// Fetch Get Parameter
$this->getRequest()->get('foo');
// Fetch Post Parameter
$this->getRequest()->post('foo');
// Fetch File Parameter
$this->getRequest()->file('foo');
// Fetch Request Parameter
$this->getRequest()->param('foo');
// Fetch All Request Parameters
$this->getRequest()->all();
// Fetch Header
$this->getRequest()->header('foo');
// Fetch Server Environment Variable
$this->getRequest()->server('foo');
// Fetch Request Method
$this->getRequest()->method();
// Fetch Request URI
$this->getRequest()->uri();
// Fetch Query String
$this->getRequest()->queryString();
// Fetch HTTP Body
$this->getRequest()->body();
Last updated
Was this helpful?