Interface IHttpService
Onbox's contract for Http requests.
Inherited Members
System.IDisposable.Dispose()
Assembly: Onbox.Abstractions.dll
Syntax
public interface IHttpService : IDisposable
Methods
|
Improve this Doc
View Source
Add a header for all subsequent requests
Declaration
IHttpService AddHeader(string name, string value)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.String |
value |
|
Returns
|
Improve this Doc
View Source
Clears all headers for all subsequent requests
Declaration
IHttpService ClearHeaders()
Returns
|
Improve this Doc
View Source
DeleteAsync(String, String)
Send a DELETE request to the specified Uri as an asynchronous operation.
Declaration
Task DeleteAsync(string endpoint, string token = null)
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
|
Improve this Doc
View Source
DeleteAsync<T>(String, String)
Send a DELETE request to the specified Uri and return the response body as an asynchronous operation.
Declaration
Task<T> DeleteAsync<T>(string endpoint, string token = null)
where T : class
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<T> |
|
Type Parameters
|
Improve this Doc
View Source
GetAsync<T>(String, String)
Send a GET request to the specified Uri as an asynchronous operation.
Declaration
Task<T> GetAsync<T>(string endpoint, string token = null)
where T : class
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<T> |
|
Type Parameters
|
Improve this Doc
View Source
GetStreamAsync(String, String)
Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation.
Declaration
Task<Stream> GetStreamAsync(string endpoint, string token = null)
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.IO.Stream> |
|
|
Improve this Doc
View Source
PatchAsync(String, Object, String)
Send a PATCH request to the specified Uri as an asynchronous operation.
Declaration
Task PatchAsync(string endpoint, object content, string token = null)
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.Object |
content |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
|
Improve this Doc
View Source
PatchAsync<T>(String, Object, String)
Send a PATCH request to the specified Uri and return the response body as an asynchronous operation.
Declaration
Task<T> PatchAsync<T>(string endpoint, object content, string token = null)
where T : class
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.Object |
content |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<T> |
|
Type Parameters
|
Improve this Doc
View Source
PostAsync(String, Object, String)
Send a POST request to the specified Uri as an asynchronous operation.
Declaration
Task PostAsync(string endpoint, object content, string token = null)
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.Object |
content |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
|
Improve this Doc
View Source
PostAsync<T>(String, Object, String)
Send a POST request to the specified Uri and return the response body as an asynchronous operation.
Declaration
Task<T> PostAsync<T>(string endpoint, object content, string token = null)
where T : class
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.Object |
content |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<T> |
|
Type Parameters
|
Improve this Doc
View Source
PostFormAsync<T>(String, IDictionary<String, String>, String)
Send a POST form request to the specified Uri and return the response body as an asynchronous operation.
Declaration
Task<T> PostFormAsync<T>(string endpoint, IDictionary<string, string> content, string token = null)
where T : class
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.Collections.Generic.IDictionary<System.String, System.String> |
content |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<T> |
|
Type Parameters
|
Improve this Doc
View Source
PostRequestStreamAsync(String, Object, String)
Send a POST request to the specified Uri and return the response body as a stream in an asynchronous operation.
Declaration
Task<Stream> PostRequestStreamAsync(string endpoint, object content, string token = null)
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.Object |
content |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.IO.Stream> |
|
|
Improve this Doc
View Source
PostStreamAsync(String, Stream, String)
Send a POST stream request to the specified Uri as an asynchronous operation.
Declaration
Task PostStreamAsync(string endpoint, Stream content, string token = null)
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.IO.Stream |
content |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
|
Improve this Doc
View Source
PostStreamAsync<T>(String, Stream, String)
Send a POST stream request to the specified Uri and return the response body as an asynchronous operation.
Declaration
Task<T> PostStreamAsync<T>(string endpoint, Stream content, string token = null)
where T : class
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.IO.Stream |
content |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<T> |
|
Type Parameters
|
Improve this Doc
View Source
PutAsync(String, Object, String)
Send a PUT request to the specified Uri as an asynchronous operation.
Declaration
Task PutAsync(string endpoint, object content, string token = null)
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.Object |
content |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
|
Improve this Doc
View Source
PutAsync<T>(String, Object, String)
Send a PUT request to the specified Uri and return the response body as an asynchronous operation.
Declaration
Task<T> PutAsync<T>(string endpoint, object content, string token = null)
where T : class
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.Object |
content |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<T> |
|
Type Parameters
|
Improve this Doc
View Source
PutRequestStreamAsync(String, Object, String)
Send a PUT request to the specified Uri and return the response body as a stream in an asynchronous operation.
Declaration
Task<Stream> PutRequestStreamAsync(string endpoint, object content, string token = null)
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.Object |
content |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.IO.Stream> |
|
|
Improve this Doc
View Source
PutStreamAsync(String, Stream, String)
Send a PUT stream request to the specified Uri as an asynchronous operation.
Declaration
Task PutStreamAsync(string enpoint, Stream content, string token = null)
Parameters
Type |
Name |
Description |
System.String |
enpoint |
|
System.IO.Stream |
content |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
|
Improve this Doc
View Source
PutStreamAsync<T>(String, Stream, String)
Send a PUT stream request to the specified Uri and return the response body as an asynchronous operation.
Declaration
Task<T> PutStreamAsync<T>(string endpoint, Stream content, string token = null)
where T : class
Parameters
Type |
Name |
Description |
System.String |
endpoint |
|
System.IO.Stream |
content |
|
System.String |
token |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<T> |
|
Type Parameters