Interface IConnection
Represents a connection to the Worldline Global Collect platform server. Thread-safe.
Inherited Members
Namespace: Worldline.Connect.Sdk.Communication
Assembly: Worldline.Connect.Sdk.dll
Syntax
public interface IConnection : IDisposable, ILoggingCapable, IObfuscationCapable
Methods
Delete<T>(Uri, IEnumerable<IRequestHeader>, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T>)
Send a DELETE request to the Worldline Global Collect platform.
Declaration
Task<T> Delete<T>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> responseHandler)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to call, including any necessary query parameters. |
IEnumerable<IRequestHeader> | requestHeaders | An optional list of request headers. |
Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<T> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Worldline Global Collect platform |
Get<T>(Uri, IEnumerable<IRequestHeader>, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T>)
Send a GET request to the Worldline Global Collect platform.
Declaration
Task<T> Get<T>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> responseHandler)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to call, including any necessary query parameters. |
IEnumerable<IRequestHeader> | requestHeaders | An optional list of request headers. |
Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<T> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Worldline Global Collect platform |
Post<T>(Uri, IEnumerable<IRequestHeader>, string, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T>)
Send a POST request to the Worldline Global Collect platform.
Declaration
Task<T> Post<T>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, string body, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> responseHandler)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to call, including any necessary query parameters. |
IEnumerable<IRequestHeader> | requestHeaders | An optional list of request headers. |
string | body | The optional body to send. |
Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<T> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Worldline Global Collect platform |
Post<T>(Uri, IEnumerable<IRequestHeader>, MultipartFormDataObject, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T>)
Send a multipart/form-data POST request to the Worldline Global Collect platform.
The content type of the request will be be part of the given request header list. If the connection creates its own content type, it should be multipart.getContentType(). Otherwise, authentication failures will occur.
Declaration
Task<T> Post<T>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, MultipartFormDataObject multipart, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> responseHandler)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to call, including any necessary query parameters. |
IEnumerable<IRequestHeader> | requestHeaders | An optional list of request headers. |
MultipartFormDataObject | multipart | The multipart/form-data request to send. |
Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<T> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Worldline Global Collect platform |
Put<T>(Uri, IEnumerable<IRequestHeader>, string, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T>)
Send a PUT request to the Worldline Global Collect platform.
Declaration
Task<T> Put<T>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, string body, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> responseHandler)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to call, including any necessary query parameters. |
IEnumerable<IRequestHeader> | requestHeaders | An optional list of request headers. |
string | body | The optional body to send. |
Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<T> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Worldline Global Collect platform |
Put<T>(Uri, IEnumerable<IRequestHeader>, MultipartFormDataObject, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T>)
Send a multipart/form-data PUT request to the Worldline Global Collect platform.
The content type of the request will be be part of the given request header list. If the connection creates its own content type, it should be multipart.getContentType(). Otherwise, authentication failures will occur.
Declaration
Task<T> Put<T>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, MultipartFormDataObject multipart, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> responseHandler)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to call, including any necessary query parameters. |
IEnumerable<IRequestHeader> | requestHeaders | An optional list of request headers. |
MultipartFormDataObject | multipart | The multipart/form-data request to send. |
Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<T> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Worldline Global Collect platform |