• Getting Started
  • Tutorials
  • Api Documentation
Show / Hide Table of Contents
  • Onbox.Abstractions.V8
    • IContainer
    • IContainerPipeline
    • IContainerResolver
    • IContainerResolverPipeline
    • IHttpService
    • IJsonService
    • ILoggingService
    • IMapper
    • IMessageService
    • IProgressIndicator
  • Onbox.Core.V8
    • CoreExtensions
    • OnboxExceptionBase
  • Onbox.Core.V8.Http
    • HttpExtensions
    • HttpInterceptor
    • HttpService
    • HttpSettings
    • IHttpInterceptor
  • Onbox.Core.V8.Json
    • JsonExtensions
    • JsonService
  • Onbox.Core.V8.Logging
    • FileLoggingService
    • FileLoggingSettings
  • Onbox.Core.V8.Mapping
    • IMapperActionManager
    • IMapperOperator
    • Mapper
    • MapperActionManager
    • MapperOperator
  • Onbox.Core.V8.Messaging
    • MessageDebugService
  • Onbox.Core.V8.ReactFactory
    • Debouncer
    • Interval
    • ReactFactory
  • Onbox.Core.V8.Reporting
    • ProgressCancelledException
    • ProgressConsoleDebugIndicator
  • Onbox.Di.V8
    • Container
  • Onbox.Mvc.Abstractions.V8
    • IMvcComponent
    • IMvcLifecycleComponent
    • IMvcLifecycleView
    • IMvcView
    • IMvcViewModal
    • IMvcViewModeless
  • Onbox.Mvc.Revit.Abstractions.V8
    • IRevitMvcViewBase
  • Onbox.Mvc.V8
    • TitleVisibility
  • Onbox.Revit.Abstractions.V8
    • IRevitAppData
  • Onbox.Revit.V8
    • ContainerProviderAttribute
    • IRevitContext
    • IRevitExternalApp
    • RevitAppData
    • RevitContainerProviderBase
    • RevitLanguage
  • Onbox.Revit.V8.Applications
    • ContainerPipelineExtensions
    • RevitApp
    • RevitAppBase<TContainer>
  • Onbox.Revit.V8.Async
    • IRevitEventHandler
    • RevitAsyncExtensions
    • RevitAsyncSettings
    • RevitExternalHandler
  • Onbox.Revit.V8.Commands
    • IRevitDestroyableCommand
    • RevitAppCommand<TApplication>
    • RevitContainerCommand<TContainerPipeline>
    • RevitContainerCommandBase<TContainerPipeline, TContainer>
  • Onbox.Revit.V8.ExtensibleStorage
    • AccessLevel
    • IRevitJsonStorage<T>
    • RevitExtensibleStorageEntensions
    • RevitExtensibleStorageSettings
    • RevitJsonStorage<T>
    • RevitSchemaSettings
    • RevitStorageBuilder
  • Onbox.Revit.V8.UI
    • ImageManager
    • IRibbonManager
    • IRibbonPanelManager
    • IRibbonTabManager
    • RibbonHelpers
    • RibbonManager
    • RibbonPanelManager
    • RibbonTabManager
  • Onbox.Store.V8
    • IStorageSubscription
    • IStore<TState>
    • IStoreAction<TState, TSlice>
    • StateEntry<TState>
    • StorageSubscription
    • Store<TState>
    • StoreExtensions

Class HttpService

Onbox's implementation for Http requests.
1 - Works with json strings for all serialzable objects

2 - IJsonService for json serialization

3 - Should be a singleton that is meant to be reused during the lifecycle of the application

4 - Provides strong typed response objects

5 - Provides request and response interception

Inheritance
System.Object
HttpService
Implements
IHttpService
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Onbox.Core.V8.Http
Assembly: Onbox.Core.dll
Syntax
public class HttpService : IHttpService, IDisposable

Constructors

| Improve this Doc View Source

HttpService(IJsonService, ILoggingService, IHttpInterceptor, HttpSettings)

Constructor

Declaration
public HttpService(IJsonService jsonService, ILoggingService loggingService, IHttpInterceptor httpInterceptor, HttpSettings httpSettings)
Parameters
Type Name Description
IJsonService jsonService
ILoggingService loggingService
IHttpInterceptor httpInterceptor
HttpSettings httpSettings

Methods

| Improve this Doc View Source

AddHeader(String, String)

Add a header to all subsequent requests

Declaration
public IHttpService AddHeader(string name, string value)
Parameters
Type Name Description
System.String name
System.String value
Returns
Type Description
IHttpService
| Improve this Doc View Source

ClearHeaders()

Clears all headers for all subsequent requests

Declaration
public IHttpService ClearHeaders()
Returns
Type Description
IHttpService
| Improve this Doc View Source

DeleteAsync(String, String)

Send a DELETE request to the specified Uri as an asynchronous operation.

Declaration
public 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
public 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
Name Description
T
| Improve this Doc View Source

Dispose()

Disposes the client

Declaration
public void Dispose()
| Improve this Doc View Source

Finalize()

Disposes the client

Declaration
protected void Finalize()
| Improve this Doc View Source

GetAsync<T>(String, String)

Send a GET request to the specified Uri as an asynchronous operation.

Declaration
public 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
Name Description
T
| 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
public 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
public 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
public 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
Name Description
T
| Improve this Doc View Source

PostAsync(String, Object, String)

Send a POST form request to the specified Uri and return the response body as an asynchronous operation.

Declaration
public 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
public 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
Name Description
T
| Improve this Doc View Source

PostFormAsync<T>(String, IDictionary<String, String>, String)

Send a POST request to the specified Uri and return the response body as a stream in an asynchronous operation.

Declaration
public 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
Name Description
T
| Improve this Doc View Source

PostRequestStreamAsync(String, Object, String)

Send a POST stream request to the specified Uri as an asynchronous operation.

Declaration
public 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 and return the response body as an asynchronous operation.

Declaration
public 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 request to the specified Uri as an asynchronous operation.

Declaration
public 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
Name Description
T
| Improve this Doc View Source

PutAsync(String, Object, String)

Send a PUT request to the specified Uri as an asynchronous operation.

Declaration
public 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
public 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
Name Description
T
| 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
public 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
public Task PutStreamAsync(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

PutStreamAsync<T>(String, Stream, String)

Send a PUT stream request to the specified Uri and return the response body as an asynchronous operation.

Declaration
public 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
Name Description
T

Implements

IHttpService
System.IDisposable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX