# HTTP

### HttpClient Class

The Http Client can be used to make HTTP requests to external services.

### Syntax

### Member Details

#### Request Method

> Performs a HTTP request.
>
> #### Syntax
>
> **Parameters**
>
> > *url*
> >
> > The url. It may include parameters, but they must be url-encoded.
> >
> > *handler*
> >
> > The event handler to be called when the request is complete
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Request Method

> Performs a HTTP request.
>
> #### Syntax
>
> **Parameters**
>
> > *url*
> >
> > The url. It may include parameters, but they must be url-encoded.
> >
> > *requestOptions*
> >
> > The request options struct
> >
> > *handler*
> >
> > The event handler to be called when the request is complete
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

***

### HttpClient.RequestData Class

The result of a [HttpClient.Request(string, HttpRequestOptions, Action\<Sansar.Simulation.HttpClient.RequestData>)](https://help.sansar.com/hc/en-us/articles/360001177466.html#M:Sansar.Simulation.HttpClient.Request\(System.String,Sansar.Simulation.HttpRequestOptions,System.Action{Sansar.Simulation.HttpClient.RequestData}\)) call.

### Syntax

### Member Details

#### Response Property

> #### Syntax
>
> \[get: Sansar.Script.Interface]\
> public [HttpResponse](https://help.sansar.com/hc/en-us/articles/360001160643) **Response** { get; }
>
> **Value**
>
> > Only valid if [Sansar.Script.OperationCompleteEvent.Success](https://help.sansar.com/hc/en-us/articles/115003436923#P:Sansar.Script.OperationCompleteEvent.Success) is true.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### ToString Method

> A string representation of this object.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public override [string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) **ToString** ()
>
> **Returns**
>
> > A string representation of this object.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

***

### HttpRequestOptions Struct

Options used for [HttpClient.Request(string, HttpRequestOptions, Action\<Sansar.Simulation.HttpClient.RequestData>)](https://help.sansar.com/hc/en-us/articles/360001177466.html#M:Sansar.Simulation.HttpClient.Request\(System.String,Sansar.Simulation.HttpRequestOptions,System.Action{Sansar.Simulation.HttpClient.RequestData}\))

### Syntax

\[Sansar.Script.Interface]\
public struct **HttpRequestOptions**

### Member Details

#### Body Field

> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) **Body**
>
> #### Remarks
>
> May be null.
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### DisableRedirect Field

> Disable automatic redirects.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [bool](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean) **DisableRedirect**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Method Field

> #### Syntax
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Parameters Field

> Request parameters.
>
> #### Syntax
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

***

### HttpResponse Struct

Data returned from [HttpClient.Request(string, HttpRequestOptions, Action\<Sansar.Simulation.HttpClient.RequestData>)](https://help.sansar.com/hc/en-us/articles/360001177466.html#M:Sansar.Simulation.HttpClient.Request\(System.String,Sansar.Simulation.HttpRequestOptions,System.Action{Sansar.Simulation.HttpClient.RequestData}\))

### Syntax

\[Sansar.Script.Interface]\
public struct **HttpResponse**

### Remarks

Documentation for this section has not yet been entered.

### Requirements

**Namespace:** Sansar.Simulation\
**Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
**Assembly Versions:** 1.1.0.0

### Members

See Also: Inherited members from [ValueType](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.ValueType).

### Public Fields

### Member Details

#### Body Field

> The response body.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) **Body**
>
> #### Remarks
>
> Documentation for this section has not yet been entered.
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Headers Field

> The headers from the response
>
> #### Syntax
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Status Field

> The status code returned by the remote server.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [int](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Int32) **Status**
>
> #### Remarks
>
> Documentation for this section has not yet been entered.
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

***


---

# 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.sansar.com/latest/script-api-docs/sansar-simulation-namespace/http.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.
