mirror of https://github.com/LordMike/TMDbLib.git

6 changed files with 14371 additions and 3 deletions
-
20TMDbLib/Client/TMDbClient.cs
-
5TMDbLib/Rest/RestClient.cs
-
9TMDbLib/Rest/RestRequest.cs
-
55TMDbLib/Utilities/TMDbAPIProxy.cs
-
7497TMDbLibTests/project.lock.json
-
6788TestApplication/project.lock.json
@ -0,0 +1,55 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Net; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace TMDbLib.Utilities |
|||
{ |
|||
/// <summary>
|
|||
/// Represents a Web Proxy to use for TMDb API Requests.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// This is a very simple implementation of a Web Proxy to be used when requesting data from TMDb API.
|
|||
/// It does not support proxy bypassing or multi-proxy configuration based on the destination URL, for instance.
|
|||
/// </remarks>
|
|||
public class TMDbAPIProxy : IWebProxy |
|||
{ |
|||
private Uri _proxyUri; |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance for this Proxy
|
|||
/// </summary>
|
|||
public TMDbAPIProxy(Uri proxyUri, ICredentials credentials = null) |
|||
{ |
|||
if (proxyUri == null) throw new ArgumentNullException("proxyUri"); |
|||
|
|||
_proxyUri = proxyUri; |
|||
Credentials = credentials; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the credentials to use for authenticating in the proxy server.
|
|||
/// </summary>
|
|||
public ICredentials Credentials |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the proxy server <see cref="Uri"/> to be used when accessing <paramref name="destination"/>.
|
|||
/// </summary>
|
|||
/// <param name="destination">The destination URL to be accessed.</param>
|
|||
/// <returns></returns>
|
|||
public Uri GetProxy(Uri destination) |
|||
{ |
|||
return _proxyUri; |
|||
} |
|||
|
|||
public bool IsBypassed(Uri host) |
|||
{ |
|||
return false; |
|||
} |
|||
} |
|||
} |
7497
TMDbLibTests/project.lock.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
6788
TestApplication/project.lock.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue