# Request methods

## \_\_construct( setup ) <a href="#construct" id="construct"></a>

* **`setup`** A hash array of optional setup values with the following possible keys
  * **`isSecurityCsrf`** Whether this request must implement CSRF security or not.
  * **`pathComponents`** An array of [RequestPathComponent](/reference/core-classes/requestpathcomponent.md) objects defining the components of this request, in the same order on which they're expected.
  * **`parameters`** An array of [RequestParameter](/reference/core-classes/requestparameter.md) objects of parameters that might be received by this request.
  * **`additionalCacheKeys`** A hash array containing additional cache keys to make this request's cached contents different depending on the values of those keys.

## buildUrl( setup ) <a href="#buildurl" id="buildurl"></a>

Builds a valid URL for the request.

* **`setup`** A hash array with the following possible keys
  * **`locale`** An optional string indicating the locale name for which to build the Url. If not specified, the current locale's domain will be used when isAbsolute is true. When specified, returned Url will be absolute.
  * **`parameterValues`** An optional hash array containing the values for the variable path components and for the GET parameters, if any.
  * **`isIncludeUrlParameters`** Includes the GET parameters in the URL. The passed `parameterValues` will be used, or the current request's parameters if no `parameterValues` are specified. Defaults to `true`.
  * **`isAbsolute`** Whether to generate an absolute URL containing additionally http(s):// and the domain of the App. Defaults to `false`
  * **`isHttps`** Set it to `true` to generate an https URL, `false` to generate an http URL or `auto` to auto-detect based on the current request.

**Returns:** A string containing the URL.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cherrycake.tin.cat/reference/core-classes/request/request-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
