The HttpClientHelper Package
Methods
Section titled “Methods”Http-Get
Section titled “Http-Get”HttpGetFile
public async Task<RequestResult<dynamic>> HttpGetFile(string url, string fileName)- General: Performs a GET request to the given endpoint (baseUrl + url). This Method also saves the file to a specific location defined in fileName.
- Param (fileName): The full path of a file to overwrite or create.
- Param (url): The endpoint url
- Returns: The request result.
HttpGetJsonObject
public async Task<RequestResult<T>> HttpGetJsonObject<T>(string url)- General: Performs a GET request to the given endpoint (baseUrl + url)
- Param (url): The endpoint url
- Returns: The request result with parsed json data object
HttpGetString
public async Task<RequestResult<string>> HttpGetString(string url)- General: Sends a request to _baseUrl + url and returns the string returned by that method.
- Param (url): The endpoint url
- Returns: The returned string from the api and the request result.
HttpGet
public async Task<RequestResult<dynamic>> HttpGet(string url)- General: Performs a GET request to the given endpoint (baseUrl + url)
- Param (url): The endpoint url
- Returns: The request result with no parsed json data.
Http-Delete
Section titled “Http-Delete”HttpDelete
public async Task<RequestResult<dynamic>> HttpDelete(string url, HttpContent? content)- General: Performs a DELETE request to the given endpoint (baseUrl + url)
- Param (content): The http content to send
- Param (url): The endpoint url.
- Returns: The request result with no deserialized data.
HttpDeleteJson
public async Task<RequestResult<dynamic>> HttpDeleteJson(string url, object? content)- General: Performs a DELETE request to the given endpoint (baseUrl + url)
- Param (content): The object which should be serialized to json.
- Param (url): The endpoint url
- Returns: The request result with no deserialized data.
HttpDeleteJsonAndGetJson
public async Task<RequestResult<T>> HttpDeleteJsonAndGetJson<T>(string url, object? content)- General: Performs a DELETE request to the given endpoint (baseUrl + url)
- Param (fileName): The full path of a file to overwrite or create.
- Param (url): The endpoint url
- Returns: The request result with the deserialized object.
HttpDeleteContentAndGetJson
public async Task<RequestResult<T>> HttpDeleteContentAndGetJson<T>(string url, HttpContent? content)- General: Performs a DELETE request to the given endpoint (baseUrl + url)
- Param (fileName): The full path of a file to overwrite or create.
- Param (url): The endpoint url
- Returns: The request result with the deserialized object.
Http-Put
Section titled “Http-Put”HttpPut
public async Task<RequestResult<dynamic>> HttpPut(string url, HttpContent? content)- General: Performs a PUT request to the given endpoint (baseUrl + url)
- Param (content): The http content
- Param (url): The endpoint url
- Returns: The request result.
HttpPutJson
public async Task<RequestResult<dynamic>> HttpPutJson(string url, object? content)- General: Performs a PUT request to the given endpoint (baseUrl + url)
- Param (content): The object which should be serialized to json.
- Param (url): The endpoint url
- Returns: The request result.
HttpPutJsonAndGetJson
public async Task<RequestResult<T>> HttpPutJsonAndGetJson<T>(string url, object? content)- General: Performs a PUT request to the given endpoint (baseUrl + url)
- Param (content): The object which should be serialized to json.
- Param (url): The endpoint url
- Returns: The request result.
HttpPutContentAndGetJson
public async Task<RequestResult<T>> HttpPutContentAndGetJson<T>(string url, HttpContent? content)- General: Performs a PUT request to the given endpoint (baseUrl + url) +Param (content): The object which should be serialized to json.
- Param (url): The endpoint url
- Returns: The request result.
Http-Patch
Section titled “Http-Patch”HttpPatch
public async Task<RequestResult<dynamic>> HttpPatch(string url, HttpContent? content)- General: Performs a PATCH request to the given endpoint (baseUrl + url)
- Param (content): The http content
- Param (url): The endpoint url
- Returns: The request result with no deserialized data.
HttpPatchJson
public async Task<RequestResult<dynamic>> HttpPatchJson(string url, object? content)- General: Performs a PATCH request to the given endpoint (baseUrl + url)
- Param (content): The object which should be serialized to json.
- Param (url): The endpoint url
- Returns: The request result with no deserialized data.
HttpPatchJsonAndGetJson
public async Task<RequestResult<T>> HttpPatchJsonAndGetJson<T>(string url, object? content)- General: Performs a PATCH request to the given endpoint (baseUrl + url)
- Param (content): The object which should be serialized to json.
- Param (url): The endpoint url
- Returns: The request result with the deserialized object.
HttpPatchContentAndGetJson
public async Task<RequestResult<T>> HttpPatchContentAndGetJson<T>(string url, HttpContent content)- General: Performs a PATCH request to the given endpoint (baseUrl + url)
- Param (content): The object which should be serialized to json.
- Param (url): The endpoint url
- Returns: The request result with the deserialized object.
Http-Post
Section titled “Http-Post”HttpPost
public async Task<RequestResult<dynamic>> HttpPost(string url, HttpContent content)- General: Performs a GET request to the given endpoint (baseUrl + url). This Method also saves the file to a specific location defined in fileName.
- Param (fileName): The full path of a file to overwrite or create.
- Param (url): The endpoint url
- Returns: The request result.
HttpPostJson
public async Task<RequestResult<dynamic>> HttpPostJson(string url, object? content)- General: Performs a GET request to the given endpoint (baseUrl + url). This Method also saves the file to a specific location defined in fileName.
- Param (fileName): The full path of a file to overwrite or create.
- Param (url): The endpoint url
- Returns: The request result.
HttpPostJsonAndGetJson
public async Task<RequestResult<T>> HttpPostJsonAndGetJson<T>(string url, object? content)- General: Performs a GET request to the given endpoint (baseUrl + url). This Method also saves the file to a specific location defined in fileName.
- Param (fileName): The full path of a file to overwrite or create.
- Param (url): The endpoint url
- Returns: The request result.
HttpPostContentAndGetJson
public async Task<RequestResult<T>> HttpPostContentAndGetJson<T>(string url, HttpContent content)- General: Performs a GET request to the given endpoint (baseUrl + url). This Method also saves the file to a specific location defined in fileName.
- Param (fileName): The full path of a file to overwrite or create.
- Param (url): The endpoint url
- Returns: The request result.