# HttpRequest

Namespace: **Wisej.Core**

Assembly: **Wisej.Framework** (4.0.0.0)

Encapsulates HTTP-request information for an ASP.NET operation.

{% tabs %}
{% tab title="C#" %}

```csharp
public class HttpRequest
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class HttpRequest
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) HttpRequest(context, request)

Constructs an new instance [HttpRequest](/api/wisej.core/general/wisej.core.httprequest.md) initialized from the original [HttpRequest](https://docs.microsoft.com/dotnet/api/system.web.httprequest).

| Name        | Type                                                                        | Description                                                                                  |
| ----------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| **context** | [HttpContext](/api/wisej.core/general/wisej.core.httpcontext.md)            | The current [HttpContext](/api/wisej.core/general/wisej.core.httpcontext.md).                |
| **request** | [HttpRequest](https://docs.microsoft.com/dotnet/api/system.web.httprequest) | Original [HttpRequest](https://docs.microsoft.com/dotnet/api/system.web.httprequest) object. |

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) ContentLength

[Int64](https://docs.microsoft.com/dotnet/api/system.int64): Returns the length, in bytes, of content sent by the client.

### ![](/files/hsR4ok3152WyAf8J2C1u) ContentType

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns the MIME content type of the incoming request.

### ![](/files/hsR4ok3152WyAf8J2C1u) Context

[HttpContext](/api/wisej.core/general/wisej.core.httpcontext.md): Returns the current [HttpContext](/api/wisej.core/general/wisej.core.httpcontext.md).

### ![](/files/hsR4ok3152WyAf8J2C1u) Files

[HttpFileCollection](/api/wisej.core/general/wisej.core.httpfilecollection.md): Returns the collection of [HttpPostedFile](/api/wisej.core/general/wisej.core.httppostedfile.md) uploaded by the client.

### ![](/files/hsR4ok3152WyAf8J2C1u) Form

[NameValueCollection](https://docs.microsoft.com/dotnet/api/system.collections.specialized.namevaluecollection): Returns the collection of form values posted with the HTTP request.

### ![](/files/hsR4ok3152WyAf8J2C1u) Headers

[NameValueCollection](https://docs.microsoft.com/dotnet/api/system.collections.specialized.namevaluecollection): Returns a collection of HTTP headers.

### ![](/files/hsR4ok3152WyAf8J2C1u) InputStream

[Stream](https://docs.microsoft.com/dotnet/api/system.io.stream): Returns the contents of the incoming HTTP entity body.

### ![](/files/hsR4ok3152WyAf8J2C1u) IsLocal

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns whether the request is from the local computer.

### ![](/files/hsR4ok3152WyAf8J2C1u) Item(key)

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns the specified value from the [QueryString](#querystring) or [Form](#form) collections.

### ![](/files/hsR4ok3152WyAf8J2C1u) Path

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns the virtual path of the current request.

### ![](/files/hsR4ok3152WyAf8J2C1u) QueryString

[NameValueCollection](https://docs.microsoft.com/dotnet/api/system.collections.specialized.namevaluecollection): Returns the collection of arguments specified in the application URL.

### ![](/files/hsR4ok3152WyAf8J2C1u) RequestType

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns the HTTP data transfer method (GET or POST) used by the client.

### ![](/files/hsR4ok3152WyAf8J2C1u) ServerVariables

[NameValueCollection](https://docs.microsoft.com/dotnet/api/system.collections.specialized.namevaluecollection): Returns the collection of [server variables.](https://www.w3schools.com/asp/coll_servervariables.asp).

### ![](/files/hsR4ok3152WyAf8J2C1u) TotalBytes

[Int64](https://docs.microsoft.com/dotnet/api/system.int64): Returns the number of bytes in the current [InputStream](#inputstream).

### ![](/files/hsR4ok3152WyAf8J2C1u) Url

[Uri](https://docs.microsoft.com/dotnet/api/system.uri): Returns the URL of the current request.

### ![](/files/hsR4ok3152WyAf8J2C1u) UrlReferrer

[Uri](https://docs.microsoft.com/dotnet/api/system.uri): Returns information about the URL of the client's previous request that linked to the current URL.

### ![](/files/hsR4ok3152WyAf8J2C1u) UserAgent

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns the raw user agent string of the client browser.

### ![](/files/hsR4ok3152WyAf8J2C1u) UserHostAddress

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns the IP host address of the remote client.

### ![](/files/hsR4ok3152WyAf8J2C1u) UserHostName

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns the DNS name of the remote client.

### ![](/files/hsR4ok3152WyAf8J2C1u) UserLanguages

[String\[\]](https://docs.microsoft.com/dotnet/api/system.string): Returns a sorted string array of client language preferences.


---

# 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://docs.wisej.com/api/wisej.core/general/wisej.core.httprequest.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.
