Interface INetworkRequestFactory
- Namespace
- MADE.Networking.Http
- Assembly
- MADE.Networking.dll
Defines an interface for creating NetworkRequest instances using a managed HttpClient.
public interface INetworkRequestFactory
- Extension Methods
Methods
Delete(string, Dictionary<string, string>?)
Creates a JsonDeleteNetworkRequest for the specified URL.
JsonDeleteNetworkRequest Delete(string url, Dictionary<string, string>? headers = null)
Parameters
urlstringThe URL for the request.
headersDictionary<string, string>Optional additional headers for the request.
Returns
- JsonDeleteNetworkRequest
A configured JsonDeleteNetworkRequest.
Get(string, Dictionary<string, string>?)
Creates a JsonGetNetworkRequest for the specified URL.
JsonGetNetworkRequest Get(string url, Dictionary<string, string>? headers = null)
Parameters
urlstringThe URL for the request.
headersDictionary<string, string>Optional additional headers for the request.
Returns
- JsonGetNetworkRequest
A configured JsonGetNetworkRequest.
GetStream(string, Dictionary<string, string>?)
Creates a StreamGetNetworkRequest for the specified URL.
StreamGetNetworkRequest GetStream(string url, Dictionary<string, string>? headers = null)
Parameters
urlstringThe URL for the request.
headersDictionary<string, string>Optional additional headers for the request.
Returns
- StreamGetNetworkRequest
A configured StreamGetNetworkRequest.
Patch(string, string?, Dictionary<string, string>?)
Creates a JsonPatchNetworkRequest for the specified URL.
JsonPatchNetworkRequest Patch(string url, string? jsonData = null, Dictionary<string, string>? headers = null)
Parameters
urlstringThe URL for the request.
jsonDatastringThe JSON data to patch.
headersDictionary<string, string>Optional additional headers for the request.
Returns
- JsonPatchNetworkRequest
A configured JsonPatchNetworkRequest.
Post(string, string?, Dictionary<string, string>?)
Creates a JsonPostNetworkRequest for the specified URL.
JsonPostNetworkRequest Post(string url, string? jsonData = null, Dictionary<string, string>? headers = null)
Parameters
urlstringThe URL for the request.
jsonDatastringThe JSON data to post.
headersDictionary<string, string>Optional additional headers for the request.
Returns
- JsonPostNetworkRequest
A configured JsonPostNetworkRequest.
PostMultipart(string, Dictionary<string, string>?)
Creates a MultipartFormDataPostNetworkRequest for the specified URL.
MultipartFormDataPostNetworkRequest PostMultipart(string url, Dictionary<string, string>? headers = null)
Parameters
urlstringThe URL for the request.
headersDictionary<string, string>Optional additional headers for the request.
Returns
Put(string, string?, Dictionary<string, string>?)
Creates a JsonPutNetworkRequest for the specified URL.
JsonPutNetworkRequest Put(string url, string? jsonData = null, Dictionary<string, string>? headers = null)
Parameters
urlstringThe URL for the request.
jsonDatastringThe JSON data to put.
headersDictionary<string, string>Optional additional headers for the request.
Returns
- JsonPutNetworkRequest
A configured JsonPutNetworkRequest.
WithClient(string)
Creates a new INetworkRequestFactory that uses the specified named HttpClient.
INetworkRequestFactory WithClient(string clientName)
Parameters
clientNamestringThe name of the HttpClient to use.
Returns
- INetworkRequestFactory
A new INetworkRequestFactory configured with the named client.