# Stackdriver Error Reporting V1beta1 Client - Class HttpRequestContext (0.26.1)

0.26.1 (latest) 0.26.0 0.25.3 0.24.0 0.23.1 0.22.10 0.21.1 0.20.2 0.19.12

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Stackdriver Error Reporting V1beta1 Client class HttpRequestContext.

HTTP request data that is related to a reported error.

This data should be provided by the application when reporting an error,
unless the
error report has been generated automatically from Google App Engine logs.

Generated from protobuf message `google.devtools.clouderrorreporting.v1beta1.HttpRequestContext`

## Namespace

Google \\ Cloud \\ ErrorReporting \\ V1beta1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ method` | `string` The type of HTTP request, such as `GET`, `POST`, etc. |
| `↳ url` | `string` The URL of the request. |
| `↳ user_agent` | `string` The user agent information that is provided with the request. |
| `↳ referrer` | `string` The referrer information that is provided with the request. |
| `↳ response_status_code` | `int` The HTTP response status code for the request. |
| `↳ remote_ip` | `string` The IP address from which the request originated. This can be IPv4, IPv6, or a token which is derived from the IP address, depending on the data that has been provided in the error report. |

### getMethod

The type of HTTP request, such as `GET`, `POST`, etc.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setMethod

The type of HTTP request, such as `GET`, `POST`, etc.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUrl

The URL of the request.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setUrl

The URL of the request.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUserAgent

The user agent information that is provided with the request.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setUserAgent

The user agent information that is provided with the request.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getReferrer

The referrer information that is provided with the request.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setReferrer

The referrer information that is provided with the request.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResponseStatusCode

The HTTP response status code for the request.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setResponseStatusCode

The HTTP response status code for the request.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRemoteIp

The IP address from which the request originated.

This can be IPv4, IPv6, or a token which is derived from the
IP address, depending on the data that has been provided
in the error report.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setRemoteIp

The IP address from which the request originated.

This can be IPv4, IPv6, or a token which is derived from the
IP address, depending on the data that has been provided
in the error report.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |