IHttpHandler
Http handler interface for cross platform specific implementations.
Summary
Members | Descriptions |
---|---|
| Clear cached responses from requests called with Post/GetWithCacheAsync. |
| Make post request with data converted to json asynchronously. |
| Make post request with data converted to json asynchronously. |
| Make post request with data converted to json asynchronously. Response is cached based on input (url, data) |
| Make post request with data converted to json asynchronously. Response is cached based on input (url, data) |
| Make get request asynchronously. |
| Make get request asynchronously. |
| Generic http request sent asynchronously. |
| Generic http request sent asynchronously. |
| Upsert response data in the data store. |
| Calculate request unique hash key. |
| Convert response to stream. |
| Convert stream to a string. |
Members
public void
ClearResponseCache
()
Clear cached responses from requests called with Post/GetWithCacheAsync.
public Task< TResponseData >
PostJsonAsync< TResponseData >
(string url, object data)
Make post request with data converted to json asynchronously.
Parameters
TResponseData
Response type
Parameters
url
Url to send the requestdata
data sent in the body
Returns
Response data deserialized to type TResponseData
public Task< TResponseData >
PostJsonAsync< TResponseData >
(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 requestdata
data sent in the bodycancellationToken
Notification that operation should be canceled
Returns
Response data deserialized to type TResponseData
public Task< TResponseData >
PostJsonWithCacheAsync< TResponseData >
(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 requestdata
data sent in the bodyreload
ignore cached value and make a request caching the result
Returns
Response data deserialized to type TResponseData
public Task< TResponseData >
PostJsonWithCacheAsync< TResponseData >
(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 requestdata
data sent in the bodycancellationToken
Notification that operation should be canceledreload
ignore cached value and make a request caching the result
Returns
Response data deserialized to type TResponseData
public Task< TResponseData >
GetJsonAsync< TResponseData >
(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 >
(string url, CancellationToken cancellationToken)
Make get request asynchronously.
Parameters
TResponseData
Response type
Parameters
url
Url to send the requestcancellationToken
Notification that operation should be canceled
Returns
Response data deserialized to type TResponseData
public Task< Stream >
SendAsync
(HttpRequestMessage request)
Generic http request sent asynchronously.
Parameters
request
request body
Returns
Stream with response
public Task< Stream >
SendAsync
(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 >
(string hashKey, TResponseData responseData)
Upsert response data in the data store.
Parameters
TResponseData
response data type
Parameters
hashKey
data keyresponseData
response data
public string
GetRequestHashKey
(string url, object data)
Calculate request unique hash key.
Parameters
url
Url to send the requestdata
data sent in the body
Returns
public Task< Stream >
BuildSendResponse
(HttpResponseMessage response)
Convert response to stream.
Parameters
response
response object
Returns
Stream with response
public Task< string >
StreamToStringAsync
(Stream stream)
Convert stream to a string.
Parameters
stream
Returns
Last updated