# IHttpHandler

Http handler interface for cross platform specific implementations.

## Summary

| Members                                                                                                                                                                                                                                                           | Descriptions                                                                                                |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `public void` [`ClearResponseCache`](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)`()`                                                                                                                | Clear cached responses from requests called with Post/GetWithCacheAsync.                                    |
| `public Task< TResponseData >` [`PostJsonAsync< TResponseData >`](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)`(string url, object data)`                                                            | Make post request with data converted to json asynchronously.                                               |
| `public Task< TResponseData >` [`PostJsonAsync< TResponseData >`](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)`(string url, object data, CancellationToken cancellationToken)`                       | Make post request with data converted to json asynchronously.                                               |
| `public Task< TResponseData >` [`PostJsonWithCacheAsync< TResponseData >`](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)`(string url, object data, bool reload)`                                      | Make post request with data converted to json asynchronously. Response is cached based on input (url, data) |
| `public Task< TResponseData >` [`PostJsonWithCacheAsync< TResponseData >`](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)`(string url, object data, CancellationToken cancellationToken, bool reload)` | Make post request with data converted to json asynchronously. Response is cached based on input (url, data) |
| `public Task< TResponseData >` [`GetJsonAsync< TResponseData >`](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)`(string url)`                                                                          | Make get request asynchronously.                                                                            |
| `public Task< TResponseData >` [`GetJsonAsync< TResponseData >`](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)`(string url, CancellationToken cancellationToken)`                                     | Make get request asynchronously.                                                                            |
| `public Task< Stream >` [`SendAsync`](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)`(HttpRequestMessage request)`                                                                                     | Generic http request sent asynchronously.                                                                   |
| `public Task< Stream >` [`SendAsync`](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)`(HttpRequestMessage request, CancellationToken cancellationToken)`                                                | Generic http request sent asynchronously.                                                                   |
| `public void` [`UpdateResponseDataCache< TResponseData >`](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)`(string hashKey, TResponseData responseData)`                                                | Upsert response data in the data store.                                                                     |
| `public string` [`GetRequestHashKey`](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)`(string url, object data)`                                                                                        | Calculate request unique hash key.                                                                          |
| `public Task< Stream >` [`BuildSendResponse`](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)`(HttpResponseMessage response)`                                                                           | Convert response to stream.                                                                                 |
| `public Task< string >` [`StreamToStringAsync`](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)`(Stream stream)`                                                                                        | Convert stream to a string.                                                                                 |

## Members

**`public void`** [**`ClearResponseCache`**](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)**`()`**

Clear cached responses from requests called with Post/GetWithCacheAsync.

**`public Task< TResponseData >`** [**`PostJsonAsync< TResponseData >`**](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)**`(string url, object data)`**

Make post request with data converted to json asynchronously.

#### Parameters

* `TResponseData` Response type

#### Parameters

* `url` Url to send the request
* `data` data sent in the body

#### Returns

Response data deserialized to type TResponseData

**`public Task< TResponseData >`** [**`PostJsonAsync< TResponseData >`**](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)**`(string url, object data, CancellationToken cancellationToken)`**

Make post request with data converted to json asynchronously.

#### Parameters

* `TResponseData` Response type

#### Parameters

* `url` Url to send the request
* `data` data sent in the body
* `cancellationToken` Notification that operation should be canceled

#### Returns

Response data deserialized to type TResponseData

**`public Task< TResponseData >`** [**`PostJsonWithCacheAsync< TResponseData >`**](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)**`(string url, object data, bool reload)`**

Make post request with data converted to json asynchronously. Response is cached based on input (url, data)

#### Parameters

* `TResponseData` Response type

#### Parameters

* `url` Url to send the request
* `data` data sent in the body
* `reload` ignore cached value and make a request caching the result

#### Returns

Response data deserialized to type TResponseData

**`public Task< TResponseData >`** [**`PostJsonWithCacheAsync< TResponseData >`**](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)**`(string url, object data, CancellationToken cancellationToken, bool reload)`**

Make post request with data converted to json asynchronously. Response is cached based on input (url, data)

#### Parameters

* `TResponseData` Response type

#### Parameters

* `url` Url to send the request
* `data` data sent in the body
* `cancellationToken` Notification that operation should be canceled
* `reload` ignore cached value and make a request caching the result

#### Returns

Response data deserialized to type TResponseData

**`public Task< TResponseData >`** [**`GetJsonAsync< TResponseData >`**](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)**`(string url)`**

Make get request asynchronously.

#### Parameters

* `TResponseData` Response type

#### Parameters

* `url` Url to send the request

#### Returns

Response data deserialized to type TResponseData

**`public Task< TResponseData >`** [**`GetJsonAsync< TResponseData >`**](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)**`(string url, CancellationToken cancellationToken)`**

Make get request asynchronously.

#### Parameters

* `TResponseData` Response type

#### Parameters

* `url` Url to send the request
* `cancellationToken` Notification that operation should be canceled

#### Returns

Response data deserialized to type TResponseData

**`public Task< Stream >`** [**`SendAsync`**](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)**`(HttpRequestMessage request)`**

Generic http request sent asynchronously.

#### Parameters

* `request` request body

#### Returns

Stream with response

**`public Task< Stream >`** [**`SendAsync`**](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)**`(HttpRequestMessage request, CancellationToken cancellationToken)`**

Generic http request sent asynchronously.

#### Parameters

* `request` request body

///

#### Parameters

* `cancellationToken` Notification that operation should be canceled

#### Returns

Stream with response

**`public void`** [**`UpdateResponseDataCache< TResponseData >`**](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)**`(string hashKey, TResponseData responseData)`**

Upsert response data in the data store.

#### Parameters

* `TResponseData` response data type

#### Parameters

* `hashKey` data key
* `responseData` response data

**`public string`** [**`GetRequestHashKey`**](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)**`(string url, object data)`**

Calculate request unique hash key.

#### Parameters

* `url` Url to send the request
* `data` data sent in the body

#### Returns

**`public Task< Stream >`** [**`BuildSendResponse`**](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)**`(HttpResponseMessage response)`**

Convert response to stream.

#### Parameters

* `response` response object

#### Returns

Stream with response

**`public Task< string >`** [**`StreamToStringAsync`**](https://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces)**`(Stream stream)`**

Convert stream to a string.

#### Parameters

* `stream`

#### Returns


---

# 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://liquiidio.gitbook.io/unity-plugin-suite/eossharp/api-docs/eossharp-core/eossharp-core-interfaces/eossharp-core-interfaces-ihttphandler.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.
