Spotify.NET/SpotifyAPI.Web/Http/Request.cs

54 lines
1.3 KiB
C#
Raw Permalink Normal View History

2020-05-01 19:05:28 +01:00
using System;
using System.Collections.Generic;
using System.Net.Http;
namespace SpotifyAPI.Web.Http
{
public class Request : IRequest
2020-05-01 19:05:28 +01:00
{
2020-05-25 17:00:38 +01:00
public Request(Uri baseAddress, Uri endpoint, HttpMethod method)
2020-05-01 19:05:28 +01:00
{
Headers = new Dictionary<string, string>();
Parameters = new Dictionary<string, string>();
2020-05-25 17:00:38 +01:00
BaseAddress = baseAddress;
Endpoint = endpoint;
Method = method;
2020-05-01 19:05:28 +01:00
}
2020-05-25 17:00:38 +01:00
public Request(Uri baseAddress, Uri endpoint, HttpMethod method, IDictionary<string, string> headers)
{
Headers = headers;
Parameters = new Dictionary<string, string>();
2020-05-25 17:00:38 +01:00
BaseAddress = baseAddress;
Endpoint = endpoint;
Method = method;
}
2020-05-25 17:00:38 +01:00
public Request(
Uri baseAddress,
Uri endpoint,
HttpMethod method,
IDictionary<string, string> headers,
IDictionary<string, string> parameters)
{
Headers = headers;
Parameters = parameters;
2020-05-25 17:00:38 +01:00
BaseAddress = baseAddress;
Endpoint = endpoint;
Method = method;
}
2020-05-01 19:05:28 +01:00
public Uri BaseAddress { get; set; }
public Uri Endpoint { get; set; }
public IDictionary<string, string> Headers { get; }
2020-05-01 19:05:28 +01:00
public IDictionary<string, string> Parameters { get; }
2020-05-01 19:05:28 +01:00
public HttpMethod Method { get; set; }
2020-05-25 17:00:38 +01:00
public object? Body { get; set; }
2020-05-01 19:05:28 +01:00
}
}