Class WMHTTPConnection
Handles the behavior for maintaining connections with external APIs.
Implements
Inherited Members
Namespace: Quantellia.WMServer.Asset.Model.HTTP
Assembly: WMServer.dll
Syntax
[HasDTO(typeof(WMHTTPConnectionDTO))]
public class WMHTTPConnection : WMAssetBase, IWMAsset, IDbEntity, IWMEntity, IDocumentedEntity, INamedEntity, IWMAssetDirectoryMember, IWMPrincipalOwned, IWMVersionableAsset, IWMOwnableResource, IWMResource
Constructors
WMHTTPConnection()
Default constructor
Declaration
public WMHTTPConnection()
WMHTTPConnection(string)
Constructor that initializes the ID
Declaration
public WMHTTPConnection(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id |
Properties
Authentication
The authentication scheme used by this connection.
Declaration
public IHTTPAuthenticationType Authentication { get; set; }
Property Value
Type | Description |
---|---|
IHTTPAuthenticationType |
AuthenticationData
The authentication token, username/password, header name, etc... for this resource. Is AES-256 encrypted on the database. Is specific to the given AuthenticationType.
Declaration
public Dictionary<string, string> AuthenticationData { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, string> |
AuthenticationType
How this connection is expected to be authenticated.
Declaration
public WMHTTPConnection.AuthType AuthenticationType { get; set; }
Property Value
Type | Description |
---|---|
WMHTTPConnection.AuthType |
Endpoint
The base URL to form the connection with. Any trailing / will be trimmed. Any WMHTTPRequest using this connection can optionally specify additional routes on top of this base URL.
Declaration
public string Endpoint { get; set; }
Property Value
Type | Description |
---|---|
string |
Headers
Required headers and values for this resource. Can be overwritten by any WMHTTPRequest using this connection.
Declaration
public Dictionary<string, string> Headers { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, string> |
Methods
BuildAndSendRequest(WMHTTPRequestDTO, HTTPRequestArgs)
Builds an HttpRequestMessage, calls it, and returns the resulting data. Authenticates, and attempts to re-authenticate once on a 401.
Declaration
public Task<HTTPRequestResponse> BuildAndSendRequest(WMHTTPRequestDTO requestParam, HTTPRequestArgs requestArgs)
Parameters
Type | Name | Description |
---|---|---|
WMHTTPRequestDTO | requestParam | The HTTPRequest asset calling this request. |
HTTPRequestArgs | requestArgs | The arguments of this request |
Returns
Type | Description |
---|---|
Task<HTTPRequestResponse> |
ResourceDefinition()
The resource operation definition for this asset.
Declaration
public static WMResourceOperationsDefinition ResourceDefinition()
Returns
Type | Description |
---|---|
WMResourceOperationsDefinition |