IHttpHandler
Http handler interface for cross platform specific implementations.
Summary
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.
public Task< TResponseData > PostJsonAsync< TResponseData >(string url, object data, CancellationToken cancellationToken)
Make post request with data converted to json asynchronously.
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)
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)
public Task< TResponseData > GetJsonAsync< TResponseData >(string url)
Make get request asynchronously.
public Task< TResponseData > GetJsonAsync< TResponseData >(string url, CancellationToken cancellationToken)
Make get request asynchronously.
public Task< Stream > SendAsync(HttpRequestMessage request)
Generic http request sent asynchronously.
public Task< Stream > SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Generic http request sent asynchronously.
public void UpdateResponseDataCache< TResponseData >(string hashKey, TResponseData responseData)
Upsert response data in the data store.
public string GetRequestHashKey(string url, object data)
Calculate request unique hash key.
public Task< Stream > BuildSendResponse(HttpResponseMessage response)
Convert response to stream.
public Task< string > StreamToStringAsync(Stream 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
TResponseDataResponse type
Parameters
urlUrl to send the requestdatadata 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
TResponseDataResponse type
Parameters
urlUrl to send the requestdatadata sent in the bodycancellationTokenNotification 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
TResponseDataResponse type
Parameters
urlUrl to send the requestdatadata sent in the bodyreloadignore 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
TResponseDataResponse type
Parameters
urlUrl to send the requestdatadata sent in the bodycancellationTokenNotification that operation should be canceledreloadignore 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
TResponseDataResponse type
Parameters
urlUrl 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
TResponseDataResponse type
Parameters
urlUrl to send the requestcancellationTokenNotification that operation should be canceled
Returns
Response data deserialized to type TResponseData
public Task< Stream > SendAsync(HttpRequestMessage request)
Generic http request sent asynchronously.
Parameters
requestrequest body
Returns
Stream with response
public Task< Stream > SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Generic http request sent asynchronously.
Parameters
requestrequest body
///
Parameters
cancellationTokenNotification 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
TResponseDataresponse data type
Parameters
hashKeydata keyresponseDataresponse data
public string GetRequestHashKey(string url, object data)
Calculate request unique hash key.
Parameters
urlUrl to send the requestdatadata sent in the body
Returns
public Task< Stream > BuildSendResponse(HttpResponseMessage response)
Convert response to stream.
Parameters
responseresponse object
Returns
Stream with response
public Task< string > StreamToStringAsync(Stream stream)
Convert stream to a string.
Parameters
stream
Returns
Last updated