# Request

> Extends Yii request handling with PSR-7 request data.

[API reference](/docs/api/index.md) › [PSR bridge](/docs/extensions/psr-bridge/reference/index.md) › [http](/docs/extensions/psr-bridge/reference/http/index.md) › Request

| class | `yii2\extensions\psrbridge\http\Request` |
| --- | --- |
| Extends | [`yii\web\Request`](/docs/api/yii/web/request/index.md) » [`yii\base\Request`](/docs/api/yii/base/request/index.md) » [`yii\base\Component`](/docs/api/yii/base/component/index.md) » [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| Implements | [`yii\base\Configurable`](/docs/api/yii/base/configurable/index.md) |
| Source | [`src/http/Request.php`](https://github.com/yii2-extensions/psr-bridge/blob/main/src/http/Request.php#L39) |

Extends Yii request handling with PSR-7 request data.

[`ServerRequestAdapter`](/docs/extensions/psr-bridge/reference/adapter/serverrequestadapter/index.md) PSR-7 to Yii request adapter.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-absoluteUrl"></span>[`$absoluteUrl`](/docs/api/yii/web/request/index.md#property-absoluteUrl) read-only | `string` | The currently requested absolute URL. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-acceptableContentTypes"></span>[`$acceptableContentTypes`](/docs/api/yii/web/request/index.md#property-acceptableContentTypes) | `array` | The content types ordered by the quality score. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-acceptableLanguages"></span>[`$acceptableLanguages`](/docs/api/yii/web/request/index.md#property-acceptableLanguages) | `array` | The languages ordered by the preference level. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-authCredentials"></span>[`$authCredentials`](/docs/api/yii/web/request/index.md#property-authCredentials) read-only | `array` | That contains exactly two elements: - 0: the username sent via HTTP authentication, `null` if the username is not given - 1: the password sent via HTTP authentication, `null` if the password is not given. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-authPassword"></span>[`$authPassword`](/docs/api/yii/web/request/index.md#property-authPassword) read-only | `string\|null` | The password sent via HTTP authentication, `null` if the password is not given. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-authUser"></span>[`$authUser`](/docs/api/yii/web/request/index.md#property-authUser) read-only | `string\|null` | The username sent via HTTP authentication, `null` if the username is not given. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-baseUrl"></span>[`$baseUrl`](/docs/api/yii/web/request/index.md#property-baseUrl) | `string` | The relative URL for the application. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-behaviors"></span>[`$behaviors`](/docs/api/yii/base/component/index.md#property-behaviors) read-only | `array<`[`yii\base\Behavior`](/docs/api/yii/base/behavior/index.md)`<static>>` | List of behaviors attached to this component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="property-bodyParams"></span>[`$bodyParams`](/docs/api/yii/web/request/index.md#property-bodyParams) | `mixed` | The request parameters given in the request body. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-contentType"></span>[`$contentType`](/docs/api/yii/web/request/index.md#property-contentType) read-only | `string` | Request content-type. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-cookies"></span>[`$cookies`](/docs/api/yii/web/request/index.md#property-cookies) read-only | [`yii\web\CookieCollection`](/docs/api/yii/web/cookiecollection/index.md) | The cookie collection. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`$cookieValidationKey`](#property-cookieValidationKey) | `string` | A secret key used for cookie validation. Default: `''`. | `Request` |
| <span id="property-csrfCookie"></span>[`$csrfCookie`](/docs/api/yii/web/request/index.md#property-csrfCookie) | `array` | The configuration for creating the CSRF [cookie](/docs/api/yii/web/cookie/index.md). Default: `['httpOnly' => true]`. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-csrfHeader"></span>[`$csrfHeader`](/docs/api/yii/web/request/index.md#property-csrfHeader) | `string` | The name of the HTTP header for sending CSRF token. Default: `self::CSRF_HEADER`. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-csrfHeaderUnsafeMethods"></span>[`$csrfHeaderUnsafeMethods`](/docs/api/yii/web/request/index.md#property-csrfHeaderUnsafeMethods) | `array` | "unsafe" methods not triggered a CORS-preflight request This property is used only when both [`$enableCsrfValidation`](/docs/api/yii/web/request/index.md#property-enableCsrfValidation) and [`$validateCsrfHeaderOnly`](/docs/api/yii/web/request/index.md#property-validateCsrfHeaderOnly) are true. Default: `['GET', 'HEAD', 'POST']`. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-csrfParam"></span>[`$csrfParam`](/docs/api/yii/web/request/index.md#property-csrfParam) | `string` | The name of the token used to prevent CSRF. Default: `'_csrf'`. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-csrfToken"></span>[`$csrfToken`](/docs/api/yii/web/request/index.md#property-csrfToken) read-only | `null\|string` | The token used to perform CSRF validation. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-csrfTokenFromHeader"></span>[`$csrfTokenFromHeader`](/docs/api/yii/web/request/index.md#property-csrfTokenFromHeader) read-only | `string\|null` | The CSRF token sent via [`$csrfHeader`](/docs/api/yii/web/request/index.md#property-csrfHeader) by browser. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-csrfTokenSafeMethods"></span>[`$csrfTokenSafeMethods`](/docs/api/yii/web/request/index.md#property-csrfTokenSafeMethods) | `array` | The name of the HTTP header for sending CSRF token. by default validate CSRF token on non-"safe" methods only This property is used only when [`$enableCsrfValidation`](/docs/api/yii/web/request/index.md#property-enableCsrfValidation) is true. Default: `['GET', 'HEAD', 'OPTIONS']`. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-enableCookieValidation"></span>[`$enableCookieValidation`](/docs/api/yii/web/request/index.md#property-enableCookieValidation) | `bool` | Whether cookies should be validated to ensure they are not tampered. Default: `true`. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-enableCsrfCookie"></span>[`$enableCsrfCookie`](/docs/api/yii/web/request/index.md#property-enableCsrfCookie) | `bool` | Whether to use cookie to persist CSRF token. Default: `true`. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-enableCsrfValidation"></span>[`$enableCsrfValidation`](/docs/api/yii/web/request/index.md#property-enableCsrfValidation) | `bool` | Whether to enable CSRF (Cross-Site Request Forgery) validation. Default: `true`. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-eTags"></span>[`$eTags`](/docs/api/yii/web/request/index.md#property-eTags) read-only | `array` | The entity tags. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-headers"></span>[`$headers`](/docs/api/yii/web/request/index.md#property-headers) read-only | [`yii\web\HeaderCollection`](/docs/api/yii/web/headercollection/index.md) | The header collection. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-hostInfo"></span>[`$hostInfo`](/docs/api/yii/web/request/index.md#property-hostInfo) | `string\|null` | Schema and hostname part (with port number if needed) of the request URL (e.g. `https://www.yiiframework.com`), null if can't be obtained from `$_SERVER` and wasn't set. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-hostName"></span>[`$hostName`](/docs/api/yii/web/request/index.md#property-hostName) read-only | `string\|null` | Hostname part of the request URL (e.g. `www.yiiframework.com`). | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-ipHeaders"></span>[`$ipHeaders`](/docs/api/yii/web/request/index.md#property-ipHeaders) | `string[]` | List of headers where proxies store the real client IP. Default: `['X-Forwarded-For']`. Available since 2.0.13. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-isAjax"></span>[`$isAjax`](/docs/api/yii/web/request/index.md#property-isAjax) read-only | `bool` | Whether this is an AJAX (XMLHttpRequest) request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-isConsoleRequest"></span>[`$isConsoleRequest`](/docs/api/yii/base/request/index.md#property-isConsoleRequest) | `bool` | The value indicating whether the current request is made via console. | [`yii\base\Request`](/docs/api/yii/base/request/index.md) |
| <span id="property-isDelete"></span>[`$isDelete`](/docs/api/yii/web/request/index.md#property-isDelete) read-only | `bool` | Whether this is a DELETE request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-isFlash"></span>[`$isFlash`](/docs/api/yii/web/request/index.md#property-isFlash) read-only | `bool` | Whether this is an Adobe Flash or Adobe Flex request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-isGet"></span>[`$isGet`](/docs/api/yii/web/request/index.md#property-isGet) read-only | `bool` | Whether this is a GET request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-isHead"></span>[`$isHead`](/docs/api/yii/web/request/index.md#property-isHead) read-only | `bool` | Whether this is a HEAD request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-isOptions"></span>[`$isOptions`](/docs/api/yii/web/request/index.md#property-isOptions) read-only | `bool` | Whether this is a OPTIONS request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-isPatch"></span>[`$isPatch`](/docs/api/yii/web/request/index.md#property-isPatch) read-only | `bool` | Whether this is a PATCH request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-isPjax"></span>[`$isPjax`](/docs/api/yii/web/request/index.md#property-isPjax) read-only | `bool` | Whether this is a PJAX request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-isPost"></span>[`$isPost`](/docs/api/yii/web/request/index.md#property-isPost) read-only | `bool` | Whether this is a POST request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-isPut"></span>[`$isPut`](/docs/api/yii/web/request/index.md#property-isPut) read-only | `bool` | Whether this is a PUT request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-isSecureConnection"></span>[`$isSecureConnection`](/docs/api/yii/web/request/index.md#property-isSecureConnection) read-only | `bool` | If the request is sent via secure channel (https). | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-method"></span>[`$method`](/docs/api/yii/web/request/index.md#property-method) read-only | `string` | Request method, such as GET, POST, HEAD, PUT, PATCH, DELETE. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-methodParam"></span>[`$methodParam`](/docs/api/yii/web/request/index.md#property-methodParam) | `string` | The name of the POST parameter that is used to indicate if a request is a PUT, PATCH or DELETE request tunneled through POST. Default: `'_method'`. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-origin"></span>[`$origin`](/docs/api/yii/web/request/index.md#property-origin) read-only | `string\|null` | URL origin of a CORS request, `null` if not available. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-parsedBody"></span>`$parsedBody` read-only | `mixed[]\|object\|null` | Parsed body; absent or discarded scalar bodies yield `null`. | `Request` |
| <span id="property-parsers"></span>`$parsers` | `array<string, class-string<object>\|array{class?: class-string<object>, __class?: class-string<object>}\|callable(): object>` | Parser definitions keyed by Content-Type. | `Request` |
| <span id="property-pathInfo"></span>[`$pathInfo`](/docs/api/yii/web/request/index.md#property-pathInfo) | `string` | Part of the request URL that is after the entry script and before the question mark. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-port"></span>[`$port`](/docs/api/yii/web/request/index.md#property-port) | `int` | Port number for insecure requests. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-portHeaders"></span>[`$portHeaders`](/docs/api/yii/web/request/index.md#property-portHeaders) | `string[]` | List of headers where proxies store the real request port. Default: `['X-Forwarded-Port']`. Available since 2.0.46. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-preferredLanguage"></span>[`$preferredLanguage`](/docs/api/yii/web/request/index.md#property-preferredLanguage) read-only | `string` | The language that the application should use. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-psr7Request"></span>`$psr7Request` | `Psr\Http\Message\ServerRequestInterface` | Attached request. | `Request` |
| <span id="property-queryParams"></span>[`$queryParams`](/docs/api/yii/web/request/index.md#property-queryParams) | `array` | The request GET parameter values. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-queryString"></span>[`$queryString`](/docs/api/yii/web/request/index.md#property-queryString) read-only | `string` | Part of the request URL that is after the question mark. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-rawBody"></span>[`$rawBody`](/docs/api/yii/web/request/index.md#property-rawBody) | `string` | The request body. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-referrer"></span>[`$referrer`](/docs/api/yii/web/request/index.md#property-referrer) read-only | `string\|null` | URL referrer, null if not available. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-remoteHost"></span>[`$remoteHost`](/docs/api/yii/web/request/index.md#property-remoteHost) read-only | `string\|null` | Remote host name, `null` if not available. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-remoteIP"></span>[`$remoteIP`](/docs/api/yii/web/request/index.md#property-remoteIP) read-only | `string\|null` | Remote IP address, `null` if not available. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-scriptFile"></span>[`$scriptFile`](/docs/api/yii/web/request/index.md#property-scriptFile) | `string` | The entry script file path. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-scriptUrl"></span>[`$scriptUrl`](/docs/api/yii/web/request/index.md#property-scriptUrl) | `string` | The relative URL of the entry script. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-secureHeaders"></span>[`$secureHeaders`](/docs/api/yii/web/request/index.md#property-secureHeaders) | `array` | Lists of headers that are, by default, subject to the trusted host configuration. Default: `['X-Forwarded-For', 'X-Forwarded-Host', 'X-Forwarded-Proto', 'X-Forwarded-Port', 'Front-End-Https', 'X-Rewrite-Url', 'X-Original-Host']`. Available since 2.0.13. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-securePort"></span>[`$securePort`](/docs/api/yii/web/request/index.md#property-securePort) | `int` | Port number for secure requests. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-secureProtocolHeaders"></span>[`$secureProtocolHeaders`](/docs/api/yii/web/request/index.md#property-secureProtocolHeaders) | `array` | List of headers to check for determining whether the connection is made via HTTPS. Default: `['X-Forwarded-Proto' => ['https'], 'Front-End-Https' => ['on']]`. Available since 2.0.13. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-serverName"></span>[`$serverName`](/docs/api/yii/web/request/index.md#property-serverName) read-only | `string\|null` | Server name, null if not available. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-serverParams"></span>`$serverParams` read-only | `mixed[]` | Server parameters for the current request. | `Request` |
| <span id="property-serverPort"></span>[`$serverPort`](/docs/api/yii/web/request/index.md#property-serverPort) read-only | `int\|null` | Server port number, null if not available. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-trustedHosts"></span>[`$trustedHosts`](/docs/api/yii/web/request/index.md#property-trustedHosts) | `array` | The configuration for trusted security related headers. Default: `[]`. Available since 2.0.13. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-uploadedFiles"></span>`$uploadedFiles` read-only | `mixed[]` | Nested bridge uploaded files. | `Request` |
| <span id="property-url"></span>[`$url`](/docs/api/yii/web/request/index.md#property-url) | `string` | The currently requested relative URL. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-userAgent"></span>[`$userAgent`](/docs/api/yii/web/request/index.md#property-userAgent) read-only | `string\|null` | User agent, null if not available. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-userHost"></span>[`$userHost`](/docs/api/yii/web/request/index.md#property-userHost) read-only | `string\|null` | User host name, null if not available. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-userIP"></span>[`$userIP`](/docs/api/yii/web/request/index.md#property-userIP) read-only | `string\|null` | User IP address, null if not available. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="property-validateCsrfHeaderOnly"></span>[`$validateCsrfHeaderOnly`](/docs/api/yii/web/request/index.md#property-validateCsrfHeaderOnly) | `bool` | Whether to use custom header only to CSRF validation of SPA. Default: `false`. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| <span id="method-__construct"></span>[`__construct()`](/docs/api/yii/base/baseobject/index.md#method-__construct) | Constructor. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__call"></span>[`__call()`](/docs/api/yii/base/component/index.md#method-__call) | Calls the named method which is not a class method. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-__clone"></span>[`__clone()`](/docs/api/yii/base/component/index.md#method-__clone) | This method is called after the object is created by cloning an existing one. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-__get"></span>[`__get()`](/docs/api/yii/base/component/index.md#method-__get) | Returns the value of a component property. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-__isset"></span>[`__isset()`](/docs/api/yii/base/component/index.md#method-__isset) | Checks if a property is set, i.e. defined and not null. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-__set"></span>[`__set()`](/docs/api/yii/base/component/index.md#method-__set) | Sets the value of a component property. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-__unset"></span>[`__unset()`](/docs/api/yii/base/component/index.md#method-__unset) | Sets a component property to be null. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-attachBehavior"></span>[`attachBehavior()`](/docs/api/yii/base/component/index.md#method-attachBehavior) | Attaches a behavior to this component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-attachBehaviors"></span>[`attachBehaviors()`](/docs/api/yii/base/component/index.md#method-attachBehaviors) | Attaches a list of behaviors to the component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-behaviors"></span>[`behaviors()`](/docs/api/yii/base/component/index.md#method-behaviors) | Returns a list of behaviors that this component should behave as. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-canGetProperty"></span>[`canGetProperty()`](/docs/api/yii/base/component/index.md#method-canGetProperty) | Returns a value indicating whether a property can be read. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-canSetProperty"></span>[`canSetProperty()`](/docs/api/yii/base/component/index.md#method-canSetProperty) | Returns a value indicating whether a property can be set. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-className"></span>[`className()`](/docs/api/yii/base/baseobject/index.md#method-className) static | Returns the fully qualified name of this class. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-detachBehavior"></span>[`detachBehavior()`](/docs/api/yii/base/component/index.md#method-detachBehavior) | Detaches a behavior from the component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-detachBehaviors"></span>[`detachBehaviors()`](/docs/api/yii/base/component/index.md#method-detachBehaviors) | Detaches all behaviors from the component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-ensureBehaviors"></span>[`ensureBehaviors()`](/docs/api/yii/base/component/index.md#method-ensureBehaviors) | Makes sure that the behaviors declared in [`behaviors()`](/docs/api/yii/base/component/index.md#method-behaviors) are attached to this component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-get"></span>[`get()`](/docs/api/yii/web/request/index.md#method-get) | Returns GET parameter with a given name. If name isn't specified, returns an array of all GET parameters. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getAbsoluteUrl"></span>[`getAbsoluteUrl()`](/docs/api/yii/web/request/index.md#method-getAbsoluteUrl) | Returns the currently requested absolute URL. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getAcceptableContentTypes"></span>[`getAcceptableContentTypes()`](/docs/api/yii/web/request/index.md#method-getAcceptableContentTypes) | Returns the content types acceptable by the end user. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getAcceptableLanguages"></span>[`getAcceptableLanguages()`](/docs/api/yii/web/request/index.md#method-getAcceptableLanguages) | Returns the languages acceptable by the end user. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`getAuthCredentials()`](#method-getAuthCredentials) | Returns Basic credentials from the current Authorization header or current server parameters. | `Request` |
| <span id="method-getAuthPassword"></span>[`getAuthPassword()`](/docs/api/yii/web/request/index.md#method-getAuthPassword) |  | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getAuthUser"></span>[`getAuthUser()`](/docs/api/yii/web/request/index.md#method-getAuthUser) |  | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getBaseUrl"></span>[`getBaseUrl()`](/docs/api/yii/web/request/index.md#method-getBaseUrl) | Returns the relative URL for the application. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getBehavior"></span>[`getBehavior()`](/docs/api/yii/base/component/index.md#method-getBehavior) | Returns the named behavior object. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-getBehaviors"></span>[`getBehaviors()`](/docs/api/yii/base/component/index.md#method-getBehaviors) | Returns all behaviors attached to this component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-getBodyParam"></span>[`getBodyParam()`](/docs/api/yii/web/request/index.md#method-getBodyParam) | Returns the named request body parameter value. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`getBodyParams()`](#method-getBodyParams) | Returns parsed body parameters with a non-`null` configured method override removed from array bodies. | `Request` |
| [`getContentType()`](#method-getContentType) | Returns the current Content-Type header, falling back to Yii when no PSR request is attached. | `Request` |
| [`getCookies()`](#method-getCookies) | Returns a read-only collection of current PSR cookies, or Yii's cookies without an attached request. | `Request` |
| <span id="method-getCsrfToken"></span>[`getCsrfToken()`](/docs/api/yii/web/request/index.md#method-getCsrfToken) | Returns the token used to perform CSRF validation. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`getCsrfTokenFromHeader()`](#method-getCsrfTokenFromHeader) | Retrieves the CSRF token from the request headers. | `Request` |
| <span id="method-getETags"></span>[`getETags()`](/docs/api/yii/web/request/index.md#method-getETags) | Gets the Etags. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`getHeaders()`](#method-getHeaders) | Retrieves HTTP headers from the current request, supporting PSR-7 and Yii fallback. | `Request` |
| <span id="method-getHostInfo"></span>[`getHostInfo()`](/docs/api/yii/web/request/index.md#method-getHostInfo) | Returns the schema and host part of the current request URL. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getHostName"></span>[`getHostName()`](/docs/api/yii/web/request/index.md#method-getHostName) | Returns the host part of the current request URL. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getIsAjax"></span>[`getIsAjax()`](/docs/api/yii/web/request/index.md#method-getIsAjax) | Returns whether this is an AJAX (XMLHttpRequest) request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getIsConsoleRequest"></span>[`getIsConsoleRequest()`](/docs/api/yii/base/request/index.md#method-getIsConsoleRequest) | Returns a value indicating whether the current request is made via command line. | [`yii\base\Request`](/docs/api/yii/base/request/index.md) |
| <span id="method-getIsDelete"></span>[`getIsDelete()`](/docs/api/yii/web/request/index.md#method-getIsDelete) | Returns whether this is a DELETE request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getIsFlash"></span>[`getIsFlash()`](/docs/api/yii/web/request/index.md#method-getIsFlash) | Returns whether this is an Adobe Flash or Flex request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getIsGet"></span>[`getIsGet()`](/docs/api/yii/web/request/index.md#method-getIsGet) | Returns whether this is a GET request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getIsHead"></span>[`getIsHead()`](/docs/api/yii/web/request/index.md#method-getIsHead) | Returns whether this is a HEAD request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getIsOptions"></span>[`getIsOptions()`](/docs/api/yii/web/request/index.md#method-getIsOptions) | Returns whether this is an OPTIONS request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getIsPatch"></span>[`getIsPatch()`](/docs/api/yii/web/request/index.md#method-getIsPatch) | Returns whether this is a PATCH request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getIsPjax"></span>[`getIsPjax()`](/docs/api/yii/web/request/index.md#method-getIsPjax) | Returns whether this is a PJAX request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getIsPost"></span>[`getIsPost()`](/docs/api/yii/web/request/index.md#method-getIsPost) | Returns whether this is a POST request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getIsPut"></span>[`getIsPut()`](/docs/api/yii/web/request/index.md#method-getIsPut) | Returns whether this is a PUT request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`getIsSecureConnection()`](#method-getIsSecureConnection) | Resolves direct transport and trusted proxy headers from the attached request. | `Request` |
| [`getMethod()`](#method-getMethod) | Retrieves the HTTP method for the current request, supporting PSR-7 and Yii fallback. | `Request` |
| <span id="method-getOrigin"></span>[`getOrigin()`](/docs/api/yii/web/request/index.md#method-getOrigin) | Returns the URL origin of a CORS request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`getParsedBody()`](#method-getParsedBody) | Returns the PSR parsed body, or normalized Yii body parameters without an attached request. | `Request` |
| <span id="method-getPathInfo"></span>[`getPathInfo()`](/docs/api/yii/web/request/index.md#method-getPathInfo) | Returns the path info of the currently requested URL. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getPort"></span>[`getPort()`](/docs/api/yii/web/request/index.md#method-getPort) | Returns the port to use for insecure requests. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getPreferredLanguage"></span>[`getPreferredLanguage()`](/docs/api/yii/web/request/index.md#method-getPreferredLanguage) | Returns the user-preferred language that should be used by this application. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`getPsr7Request()`](#method-getPsr7Request) | Returns the attached PSR request, including any body parsing performed during binding. | `Request` |
| <span id="method-getQueryParam"></span>[`getQueryParam()`](/docs/api/yii/web/request/index.md#method-getQueryParam) | Returns the named GET parameter value. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`getQueryParams()`](#method-getQueryParams) | Returns resolved Yii query parameters when non-empty, otherwise the attached PSR query parameters. | `Request` |
| [`getQueryString()`](#method-getQueryString) | Retrieves the query string from the current request, supporting PSR-7 and Yii fallback. | `Request` |
| [`getRawBody()`](#method-getRawBody) | Retrieves the raw body content from the current request, supporting PSR-7 and Yii fallback. | `Request` |
| <span id="method-getReferrer"></span>[`getReferrer()`](/docs/api/yii/web/request/index.md#method-getReferrer) | Returns the URL referrer. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`getRemoteHost()`](#method-getRemoteHost) | Retrieves the remote host name for the current request, supporting PSR-7 and Yii fallback. | `Request` |
| [`getRemoteIP()`](#method-getRemoteIP) | Retrieves the remote IP address for the current request, supporting PSR-7 and Yii fallback. | `Request` |
| <span id="method-getScriptFile"></span>[`getScriptFile()`](/docs/api/yii/web/request/index.md#method-getScriptFile) | Returns the entry script file path. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`getScriptUrl()`](#method-getScriptUrl) | Returns the request script URL. | `Request` |
| <span id="method-getSecurePort"></span>[`getSecurePort()`](/docs/api/yii/web/request/index.md#method-getSecurePort) | Returns the port to use for secure requests. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`getServerName()`](#method-getServerName) | Retrieves the server name for the current request, supporting PSR-7 and Yii fallback. | `Request` |
| [`getServerParam()`](#method-getServerParam) | Retrieves a server parameter by name from the current request, supporting PSR-7 and Yii fallback. | `Request` |
| [`getServerParams()`](#method-getServerParams) | Retrieves server parameters from the current request, supporting PSR-7 and Yii fallback. | `Request` |
| [`getServerPort()`](#method-getServerPort) | Retrieves the server port number for the current request, supporting PSR-7 and Yii fallback. | `Request` |
| [`getUploadedFiles()`](#method-getUploadedFiles) | Converts attached PSR upload trees to bridge uploaded-file objects, preserving keys and nesting. | `Request` |
| [`getUrl()`](#method-getUrl) | Retrieves the URL of the current request, supporting PSR-7 and Yii fallback. | `Request` |
| <span id="method-getUserAgent"></span>[`getUserAgent()`](/docs/api/yii/web/request/index.md#method-getUserAgent) | Returns the user agent. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getUserHost"></span>[`getUserHost()`](/docs/api/yii/web/request/index.md#method-getUserHost) | Returns the user host name. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getUserIP"></span>[`getUserIP()`](/docs/api/yii/web/request/index.md#method-getUserIP) | Returns the user IP address. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-hasEventHandlers"></span>[`hasEventHandlers()`](/docs/api/yii/base/component/index.md#method-hasEventHandlers) | Returns a value indicating whether there is any handler attached to the named event. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-hasMethod"></span>[`hasMethod()`](/docs/api/yii/base/component/index.md#method-hasMethod) | Returns a value indicating whether a method is defined. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-hasProperty"></span>[`hasProperty()`](/docs/api/yii/base/component/index.md#method-hasProperty) | Returns a value indicating whether a property is defined for this component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-init"></span>[`init()`](/docs/api/yii/base/baseobject/index.md#method-init) | Initializes the object. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-off"></span>[`off()`](/docs/api/yii/base/component/index.md#method-off) | Detaches an existing event handler from this component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-on"></span>[`on()`](/docs/api/yii/base/component/index.md#method-on) | Attaches an event handler to an event. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-parseAcceptHeader"></span>[`parseAcceptHeader()`](/docs/api/yii/web/request/index.md#method-parseAcceptHeader) | Parses the given `Accept` (or `Accept-Language`) header. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-post"></span>[`post()`](/docs/api/yii/web/request/index.md#method-post) | Returns POST parameter with a given name. If name isn't specified, returns an array of all POST parameters. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`resolve()`](#method-resolve) | Resolves the route with Yii's URL manager and merges route parameters over PSR query parameters. | `Request` |
| <span id="method-setAcceptableContentTypes"></span>[`setAcceptableContentTypes()`](/docs/api/yii/web/request/index.md#method-setAcceptableContentTypes) | Sets the acceptable content types. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-setAcceptableLanguages"></span>[`setAcceptableLanguages()`](/docs/api/yii/web/request/index.md#method-setAcceptableLanguages) |  | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-setBaseUrl"></span>[`setBaseUrl()`](/docs/api/yii/web/request/index.md#method-setBaseUrl) | Sets the relative URL for the application. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`setBodyParams()`](#method-setBodyParams) | Honors Yii body overrides without mutating the immutable PSR request. | `Request` |
| <span id="method-setHostInfo"></span>[`setHostInfo()`](/docs/api/yii/web/request/index.md#method-setHostInfo) | Sets the schema and host part of the application URL. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-setIsConsoleRequest"></span>[`setIsConsoleRequest()`](/docs/api/yii/base/request/index.md#method-setIsConsoleRequest) | Sets the value indicating whether the current request is made via command line. | [`yii\base\Request`](/docs/api/yii/base/request/index.md) |
| <span id="method-setPathInfo"></span>[`setPathInfo()`](/docs/api/yii/web/request/index.md#method-setPathInfo) | Sets the path info of the current request. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-setPort"></span>[`setPort()`](/docs/api/yii/web/request/index.md#method-setPort) | Sets the port to use for insecure requests. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`setPsr7Request()`](#method-setPsr7Request) | Binds a PSR request, resets resolved query parameters, and registers its upload adapter. | `Request` |
| <span id="method-setQueryParams"></span>[`setQueryParams()`](/docs/api/yii/web/request/index.md#method-setQueryParams) | Sets the request [`$queryString`](/docs/api/yii/web/request/index.md#property-queryString) parameters. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-setRawBody"></span>[`setRawBody()`](/docs/api/yii/web/request/index.md#method-setRawBody) | Sets the raw HTTP request body, this method is mainly used by test scripts to simulate raw HTTP requests. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-setScriptFile"></span>[`setScriptFile()`](/docs/api/yii/web/request/index.md#method-setScriptFile) | Sets the entry script file path. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| [`setScriptUrl()`](#method-setScriptUrl) | Preserves an explicitly configured entry script URL when a PSR request is attached. | `Request` |
| <span id="method-setSecurePort"></span>[`setSecurePort()`](/docs/api/yii/web/request/index.md#method-setSecurePort) | Sets the port to use for secure requests. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-setUrl"></span>[`setUrl()`](/docs/api/yii/web/request/index.md#method-setUrl) | Sets the currently requested relative URL. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-trigger"></span>[`trigger()`](/docs/api/yii/base/component/index.md#method-trigger) | Triggers an event. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-validateCsrfToken"></span>[`validateCsrfToken()`](/docs/api/yii/web/request/index.md#method-validateCsrfToken) | Performs the CSRF validation. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-createCsrfCookie"></span>[`createCsrfCookie()`](/docs/api/yii/web/request/index.md#method-createCsrfCookie) protected | Creates a cookie with a randomly generated CSRF token. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-filterHeaders"></span>[`filterHeaders()`](/docs/api/yii/web/request/index.md#method-filterHeaders) protected | Filters headers according to the [`$trustedHosts`](/docs/api/yii/web/request/index.md#property-trustedHosts). | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-generateCsrfToken"></span>[`generateCsrfToken()`](/docs/api/yii/web/request/index.md#method-generateCsrfToken) protected | Generates an unmasked random token used to perform CSRF validation. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getIpValidator"></span>[`getIpValidator()`](/docs/api/yii/web/request/index.md#method-getIpValidator) protected | Creates instance of [`IpValidator`](/docs/api/yii/validators/ipvalidator/index.md). | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getSecureForwardedHeaderParts"></span>[`getSecureForwardedHeaderParts()`](/docs/api/yii/web/request/index.md#method-getSecureForwardedHeaderParts) protected | Returns decoded forwarded header | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getSecureForwardedHeaderTrustedPart"></span>[`getSecureForwardedHeaderTrustedPart()`](/docs/api/yii/web/request/index.md#method-getSecureForwardedHeaderTrustedPart) protected | Gets first `Forwarded` header value for token | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getSecureForwardedHeaderTrustedParts"></span>[`getSecureForwardedHeaderTrustedParts()`](/docs/api/yii/web/request/index.md#method-getSecureForwardedHeaderTrustedParts) protected | Gets only trusted `Forwarded` header parts | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getTrustedHeaders"></span>[`getTrustedHeaders()`](/docs/api/yii/web/request/index.md#method-getTrustedHeaders) protected | Trusted headers according to the [`$trustedHosts`](/docs/api/yii/web/request/index.md#property-trustedHosts). | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getUserIpFromIpHeader"></span>[`getUserIpFromIpHeader()`](/docs/api/yii/web/request/index.md#method-getUserIpFromIpHeader) protected | Return user IP's from IP header. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-getUserIpFromIpHeaders"></span>[`getUserIpFromIpHeaders()`](/docs/api/yii/web/request/index.md#method-getUserIpFromIpHeaders) protected | Returns the user IP address from [`$ipHeaders`](/docs/api/yii/web/request/index.md#property-ipHeaders). | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-loadCookies"></span>[`loadCookies()`](/docs/api/yii/web/request/index.md#method-loadCookies) protected | Converts `$_COOKIE` into an array of [`Cookie`](/docs/api/yii/web/cookie/index.md). | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-loadCsrfToken"></span>[`loadCsrfToken()`](/docs/api/yii/web/request/index.md#method-loadCsrfToken) protected | Loads the CSRF token from cookie or session. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-resolvePathInfo"></span>[`resolvePathInfo()`](/docs/api/yii/web/request/index.md#method-resolvePathInfo) protected | Resolves the path info part of the currently requested URL. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |
| <span id="method-resolveRequestUri"></span>[`resolveRequestUri()`](/docs/api/yii/web/request/index.md#method-resolveRequestUri) protected | Resolves the request URI portion for the currently requested URL. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |

## Constants

| Constant | Value | Description | Defined by |
| --- | --- | --- | --- |
| <span id="const-CSRF_HEADER"></span>[`CSRF_HEADER`](/docs/api/yii/web/request/index.md#const-CSRF_HEADER) | `'X-CSRF-Token'` | Default name of the HTTP header for sending CSRF token. | [`yii\web\Request`](/docs/api/yii/web/request/index.md) |

## Property details

### $cookieValidationKey <span id="property-cookieValidationKey"></span>

```php
public string $cookieValidationKey = ''
```

A secret key used for cookie validation.

This property must be set if [`$enableCookieValidation`](/docs/api/yii/web/request/index.md#property-enableCookieValidation) is `true`.

## Method details

### getAuthCredentials() <span id="method-getAuthCredentials"></span>

```php
public function getAuthCredentials(): array{0: string|null, 1: string|null}
```

Returns Basic credentials from the current Authorization header or current server parameters.

When a PSR request is attached, fallback uses its `PHP_AUTH_USER` and `PHP_AUTH_PW` only, not worker globals.
Malformed Basic encoding or invalid UTF-8 yields `[null, null]`.

**Returns**

`array{0: string|null, 1: string|null}`: Username and password.

### getBodyParams() <span id="method-getBodyParams"></span>

```php
public function getBodyParams(): mixed[]|object
```

Returns parsed body parameters with a non-`null` configured method override removed from array bodies.

**Returns**

`mixed[]|object`: Body parameters; absent or discarded scalar bodies become `[]`.

**Throws**

- [`yii\base\InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md): when a fallback Yii parser definition is invalid.

### getContentType() <span id="method-getContentType"></span>

```php
public function getContentType(): string
```

Returns the current Content-Type header, falling back to Yii when no PSR request is attached.

**Returns**

`string`: Header value, or an empty `string` when absent.

### getCookies() <span id="method-getCookies"></span>

```php
public function getCookies(): yii\web\CookieCollection
```

Returns a read-only collection of current PSR cookies, or Yii's cookies without an attached request.

Validated PSR cookies must contain a valid Yii signature and matching encoded cookie name.

**Returns**

[`yii\web\CookieCollection`](/docs/api/yii/web/cookiecollection/index.md): Current request cookies.

**Throws**

- [`yii\base\InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md): when cookie validation is enabled without a key.

### getCsrfTokenFromHeader() <span id="method-getCsrfTokenFromHeader"></span>

```php
public function getCsrfTokenFromHeader(): string|null
```

Retrieves the CSRF token from the request headers.

This method uses [`getHeaders()`](/docs/extensions/psr-bridge/reference/http/request/index.md#method-getHeaders) to access the header collection and retrieves the value for
`csrfHeader`.

**Returns**

`string|null`: CSRF token value from the request header, or `null` if not present.

### getHeaders() <span id="method-getHeaders"></span>

```php
public function getHeaders(): yii\web\HeaderCollection
```

Retrieves HTTP headers from the current request, supporting PSR-7 and Yii fallback.

Returns a [`HeaderCollection`](/docs/api/yii/web/headercollection/index.md) containing all HTTP headers extracted from the PSR-7 ServerRequestInterface if
the adapter is set.

**Returns**

[`yii\web\HeaderCollection`](/docs/api/yii/web/headercollection/index.md): Collection of HTTP headers for the current request.

### getIsSecureConnection() <span id="method-getIsSecureConnection"></span>

```php
public function getIsSecureConnection(): bool
```

Resolves direct transport and trusted proxy headers from the attached request.

**Returns**

`bool`

### getMethod() <span id="method-getMethod"></span>

```php
public function getMethod(): string
```

Retrieves the HTTP method for the current request, supporting PSR-7 and Yii fallback.

**Returns**

`string`: Resolved HTTP method for the current request.

### getParsedBody() <span id="method-getParsedBody"></span>

```php
public function getParsedBody(): mixed[]|object|null
```

Returns the PSR parsed body, or normalized Yii body parameters without an attached request.

**Returns**

`mixed[]|object|null`: Parsed body; absent or discarded scalar bodies yield `null`.

**Throws**

- [`yii\base\InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md): when a fallback Yii parser definition is invalid.

### getPsr7Request() <span id="method-getPsr7Request"></span>

```php
public function getPsr7Request(): Psr\Http\Message\ServerRequestInterface
```

Returns the attached PSR request, including any body parsing performed during binding.

Call [`setPsr7Request()`](/docs/extensions/psr-bridge/reference/http/request/index.md#method-setPsr7Request) first; this method does not create a request from Yii globals.

**Returns**

`Psr\Http\Message\ServerRequestInterface`: Attached request.

**Throws**

- [`yii\base\InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md): when no PSR request has been attached.

### getQueryParams() <span id="method-getQueryParams"></span>

```php
public function getQueryParams(): mixed[]
```

Returns resolved Yii query parameters when non-empty, otherwise the attached PSR query parameters.

Without an attached request, delegates to Yii. Binding a replacement request clears resolved parameters.

**Returns**

`mixed[]`: Current query parameters.

### getQueryString() <span id="method-getQueryString"></span>

```php
public function getQueryString(): string
```

Retrieves the query string from the current request, supporting PSR-7 and Yii fallback.

**Returns**

`string`: Query string for the current request.

### getRawBody() <span id="method-getRawBody"></span>

```php
public function getRawBody(): string
```

Retrieves the raw body content from the current request, supporting PSR-7 and Yii fallback.

**Returns**

`string`: Raw body content for the current request.

### getRemoteHost() <span id="method-getRemoteHost"></span>

```php
public function getRemoteHost(): string|null
```

Retrieves the remote host name for the current request, supporting PSR-7 and Yii fallback.

**Returns**

`string|null`: Remote host name for the current request, or `null` if not available.

### getRemoteIP() <span id="method-getRemoteIP"></span>

```php
public function getRemoteIP(): string|null
```

Retrieves the remote IP address for the current request, supporting PSR-7 and Yii fallback.

**Returns**

`string|null`: Remote IP address for the current request, or `null` if not available or invalid.

### getScriptUrl() <span id="method-getScriptUrl"></span>

```php
public function getScriptUrl(): string
```

Returns the request script URL.

**Returns**

`string`: Script URL for the current request.

**Throws**

- [`yii\base\InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md): if unable to determine the entry script URL.

### getServerName() <span id="method-getServerName"></span>

```php
public function getServerName(): string|null
```

Retrieves the server name for the current request, supporting PSR-7 and Yii fallback.

**Returns**

`string|null`: Server name for the current request, or `null` if not available.

### getServerParam() <span id="method-getServerParam"></span>

```php
public function getServerParam(string $name, mixed $default = null): mixed
```

Retrieves a server parameter by name from the current request, supporting PSR-7 and Yii fallback.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$name` | `string` | Name of the server parameter to retrieve. |
| `$default` | `mixed` | Default value to return if the parameter is not set. |

**Returns**

`mixed`: Value of the server parameter, or the default value if not set.

### getServerParams() <span id="method-getServerParams"></span>

```php
public function getServerParams(): mixed[]
```

Retrieves server parameters from the current request, supporting PSR-7 and Yii fallback.

**Returns**

`mixed[]`: Server parameters for the current request.

### getServerPort() <span id="method-getServerPort"></span>

```php
public function getServerPort(): int|null
```

Retrieves the server port number for the current request, supporting PSR-7 and Yii fallback.

**Returns**

`int|null`: Server port number, or `null` if unavailable.

### getUploadedFiles() <span id="method-getUploadedFiles"></span>

```php
public function getUploadedFiles(): mixed[]
```

Converts attached PSR upload trees to bridge uploaded-file objects, preserving keys and nesting.

Successful conversion detaches each PSR upload stream for Yii resource access. Failed uploads retain their
error without accessing a stream. Returns `[]` when no PSR request is attached; it does not read `$_FILES`.

**Returns**

`mixed[]`: Nested bridge uploaded files.

### getUrl() <span id="method-getUrl"></span>

```php
public function getUrl(): string
```

Retrieves the URL of the current request, supporting PSR-7 and Yii fallback.

**Returns**

`string`: URL of the current request.

**Throws**

- [`yii\base\InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md): if the configuration is invalid or incomplete.

### resolve() <span id="method-resolve"></span>

```php
public function resolve(): mixed[]
```

Resolves the route with Yii's URL manager and merges route parameters over PSR query parameters.

Without an attached request, delegates to Yii's route resolution.

**Returns**

`mixed[]`: Route and merged parameters as a two-element array.

**Throws**

- [`yii\web\NotFoundHttpException`](/docs/api/yii/web/notfoundhttpexception/index.md): when the URL manager cannot resolve the request.

### setBodyParams() <span id="method-setBodyParams"></span>

```php
public function setBodyParams(mixed $values): mixed
```

Honors Yii body overrides without mutating the immutable PSR request.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$values` | `mixed` | Body override, or `null` to resume the attached request body. |

**Returns**

`mixed`

### setPsr7Request() <span id="method-setPsr7Request"></span>

```php
public function setPsr7Request(Psr\Http\Message\ServerRequestInterface $request): void
```

Binds a PSR request, resets resolved query parameters, and registers its upload adapter.

Use a fresh Request for each HTTP request: inherited Yii proxy-resolution caches are not reset by rebinding.
Parses unparsed bodies with configured parsers or the urlencoded fallback. Scalar parser
results are discarded. Existing non-`null` parsed bodies, including `[]`, are preserved.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$request` | `Psr\Http\Message\ServerRequestInterface` | Request to bind. |

**Throws**

- [`yii\base\InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md): when a configured parser does not implement Yii's request parser contract.

### setScriptUrl() <span id="method-setScriptUrl"></span>

```php
public function setScriptUrl(string|null $value): mixed
```

Preserves an explicitly configured entry script URL when a PSR request is attached.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|null` | Script URL, or `null` to restore automatic resolution. |

**Returns**

`mixed`