Method Post
Post<T>(String, String, T)
Sends a http(s) post request
Declaration
public static string Post<T>(string uri, string payloadName, T payload)
Parameters
Type | Name | Description |
---|---|---|
System.String | uri | The url |
System.String | payloadName | Json key name of the payload |
T | payload | The payload to post |
Returns
Type | Description |
---|---|
System.String | The result of the post |
Type Parameters
Name | Description |
---|---|
T |
Post(String, String, String, String)
Sends a http(s) JSON POST request asynchronously
Declaration
public static async Task<string> Post(string uri, string content, string authorizationType, string authorizationKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | uri | The url to call |
System.String | content | The content to send |
System.String | authorizationType | Type of authorization |
System.String | authorizationKey | Authorization key |
Returns
Type | Description |
---|---|
Task<System.String> | String response |
Post(String, String, String, String, Double)
Sends a http(s) JSON POST request asynchronously
Declaration
public static async Task<string> Post(string uri, string content, string authorizationType, string authorizationKey, double timeout)
Parameters
Type | Name | Description |
---|---|---|
System.String | uri | The url to call |
System.String | content | The content to send |
System.String | authorizationType | Type of authorization |
System.String | authorizationKey | Authorization key |
System.Double | timeout | Timeout duration |
Returns
Type | Description |
---|---|
Task<System.String> | String response |
Post(String, String, Dictionary<String, String>, String)
Sends an http(s) POST request asynchronously
Declaration
public static async Task<string> Post(string uri, string data, Dictionary<string, string> headers, string contentType)
Parameters
Type | Name | Description |
---|---|---|
System.String | uri | The parameterized url |
System.String | data | http body |
Dictionary<System.String, System.String> | headers | http headers |
System.String | contentType | http content type i.e. text/plain; charset=UTF-8 |
Returns
Type | Description |
---|---|
Task<System.String> | Response from request |
Post(String, String, String)
Declaration
public static async Task<string> Post(string uri, string data, string contentType)
Parameters
Type | Name | Description |
---|---|---|
System.String | uri | |
System.String | data | |
System.String | contentType |
Returns
Type | Description |
---|---|
Task<System.String> |
Post(String, String, Dictionary<String, String>)
Sends an http(s) POST request asynchronously
Declaration
public static async Task<string> Post(string uri, string data, Dictionary<string, string> headers)
Parameters
Type | Name | Description |
---|---|---|
System.String | uri | The parameterized url |
System.String | data | http body |
Dictionary<System.String, System.String> | headers | http headers |
Returns
Type | Description |
---|---|
Task<System.String> | Response from request |
Post(String, String, Dictionary<String, String>, String, String)
Sends an http(s) POST request asynchronously
Declaration
public static async Task<string> Post(string uri, string data, Dictionary<string, string> headers, string contentType, string host)
Parameters
Type | Name | Description |
---|---|---|
System.String | uri | The parameterized url |
System.String | data | http body |
Dictionary<System.String, System.String> | headers | http headers |
System.String | contentType | http content type i.e. text/plain; charset=UTF-8 |
System.String | host | Host to be added in dedicated header |
Returns
Type | Description |
---|---|
Task<System.String> | Response from request |