11using Newtonsoft . Json ;
22using System ;
33using System . Collections . Generic ;
4+ using System . Net . Http . Headers ;
45using System . Threading . Tasks ;
56using SpotifyAPI . Web . Models ;
67
@@ -15,44 +16,44 @@ public interface IClient : IDisposable
1516 /// </summary>
1617 /// <param name="url">An URL</param>
1718 /// <returns></returns>
18- Tuple < ResponseInfo , string > Download ( string url ) ;
19+ Tuple < ResponseInfo , string > Download ( string url , Dictionary < string , string > headers = null ) ;
1920
2021 /// <summary>
2122 /// Downloads data async from an URL and returns it
2223 /// </summary>
2324 /// <param name="url"></param>
2425 /// <returns></returns>
25- Task < Tuple < ResponseInfo , string > > DownloadAsync ( string url ) ;
26+ Task < Tuple < ResponseInfo , string > > DownloadAsync ( string url , Dictionary < string , string > headers = null ) ;
2627
2728 /// <summary>
2829 /// Downloads data from an URL and returns it
2930 /// </summary>
3031 /// <param name="url">An URL</param>
3132 /// <returns></returns>
32- Tuple < ResponseInfo , byte [ ] > DownloadRaw ( string url ) ;
33+ Tuple < ResponseInfo , byte [ ] > DownloadRaw ( string url , Dictionary < string , string > headers = null ) ;
3334
3435 /// <summary>
3536 /// Downloads data async from an URL and returns it
3637 /// </summary>
3738 /// <param name="url"></param>
3839 /// <returns></returns>
39- Task < Tuple < ResponseInfo , byte [ ] > > DownloadRawAsync ( string url ) ;
40+ Task < Tuple < ResponseInfo , byte [ ] > > DownloadRawAsync ( string url , Dictionary < string , string > headers = null ) ;
4041
4142 /// <summary>
4243 /// Downloads data from an URL and converts it to an object
4344 /// </summary>
4445 /// <typeparam name="T">The Type which the object gets converted to</typeparam>
4546 /// <param name="url">An URL</param>
4647 /// <returns></returns>
47- Tuple < ResponseInfo , T > DownloadJson < T > ( string url ) ;
48+ Tuple < ResponseInfo , T > DownloadJson < T > ( string url , Dictionary < string , string > headers = null ) ;
4849
4950 /// <summary>
5051 /// Downloads data async from an URL and converts it to an object
5152 /// </summary>
5253 /// <typeparam name="T">The Type which the object gets converted to</typeparam>
5354 /// <param name="url">An URL</param>
5455 /// <returns></returns>
55- Task < Tuple < ResponseInfo , T > > DownloadJsonAsync < T > ( string url ) ;
56+ Task < Tuple < ResponseInfo , T > > DownloadJsonAsync < T > ( string url , Dictionary < string , string > headers = null ) ;
5657
5758 /// <summary>
5859 /// Uploads data from an URL and returns the response
@@ -61,7 +62,7 @@ public interface IClient : IDisposable
6162 /// <param name="body">The Body-Data (most likely a JSON String)</param>
6263 /// <param name="method">The Upload-method (POST,DELETE,PUT)</param>
6364 /// <returns></returns>
64- Tuple < ResponseInfo , string > Upload ( string url , string body , string method ) ;
65+ Tuple < ResponseInfo , string > Upload ( string url , string body , string method , Dictionary < string , string > headers = null ) ;
6566
6667 /// <summary>
6768 /// Uploads data async from an URL and returns the response
@@ -70,7 +71,7 @@ public interface IClient : IDisposable
7071 /// <param name="body">The Body-Data (most likely a JSON String)</param>
7172 /// <param name="method">The Upload-method (POST,DELETE,PUT)</param>
7273 /// <returns></returns>
73- Task < Tuple < ResponseInfo , string > > UploadAsync ( string url , string body , string method ) ;
74+ Task < Tuple < ResponseInfo , string > > UploadAsync ( string url , string body , string method , Dictionary < string , string > headers = null ) ;
7475
7576 /// <summary>
7677 /// Uploads data from an URL and returns the response
@@ -79,7 +80,7 @@ public interface IClient : IDisposable
7980 /// <param name="body">The Body-Data (most likely a JSON String)</param>
8081 /// <param name="method">The Upload-method (POST,DELETE,PUT)</param>
8182 /// <returns></returns>
82- Tuple < ResponseInfo , byte [ ] > UploadRaw ( string url , string body , string method ) ;
83+ Tuple < ResponseInfo , byte [ ] > UploadRaw ( string url , string body , string method , Dictionary < string , string > headers = null ) ;
8384
8485 /// <summary>
8586 /// Uploads data async from an URL and returns the response
@@ -88,7 +89,7 @@ public interface IClient : IDisposable
8889 /// <param name="body">The Body-Data (most likely a JSON String)</param>
8990 /// <param name="method">The Upload-method (POST,DELETE,PUT)</param>
9091 /// <returns></returns>
91- Task < Tuple < ResponseInfo , byte [ ] > > UploadRawAsync ( string url , string body , string method ) ;
92+ Task < Tuple < ResponseInfo , byte [ ] > > UploadRawAsync ( string url , string body , string method , Dictionary < string , string > headers = null ) ;
9293
9394 /// <summary>
9495 /// Uploads data from an URL and converts the response to an object
@@ -98,7 +99,7 @@ public interface IClient : IDisposable
9899 /// <param name="body">The Body-Data (most likely a JSON String)</param>
99100 /// <param name="method">The Upload-method (POST,DELETE,PUT)</param>
100101 /// <returns></returns>
101- Tuple < ResponseInfo , T > UploadJson < T > ( string url , string body , string method ) ;
102+ Tuple < ResponseInfo , T > UploadJson < T > ( string url , string body , string method , Dictionary < string , string > headers = null ) ;
102103
103104 /// <summary>
104105 /// Uploads data async from an URL and converts the response to an object
@@ -108,25 +109,6 @@ public interface IClient : IDisposable
108109 /// <param name="body">The Body-Data (most likely a JSON String)</param>
109110 /// <param name="method">The Upload-method (POST,DELETE,PUT)</param>
110111 /// <returns></returns>
111- Task < Tuple < ResponseInfo , T > > UploadJsonAsync < T > ( string url , string body , string method ) ;
112-
113- /// <summary>
114- /// Sets a specific Header
115- /// </summary>
116- /// <param name="header">Header name</param>
117- /// <param name="value">Header value</param>
118- void SetHeader ( string header , string value ) ;
119-
120- /// <summary>
121- /// Removes a specific Header
122- /// </summary>
123- /// <param name="header">Header name</param>
124- void RemoveHeader ( string header ) ;
125-
126- /// <summary>
127- /// Gets all current Headers
128- /// </summary>
129- /// <returns>A collection of Header KeyValue Pairs</returns>
130- List < KeyValuePair < string , string > > GetHeaders ( ) ;
112+ Task < Tuple < ResponseInfo , T > > UploadJsonAsync < T > ( string url , string body , string method , Dictionary < string , string > headers = null ) ;
131113 }
132114}
0 commit comments