|
|
@ -24,10 +24,9 @@ namespace NzbDrone.Common.Http
|
|
|
|
public bool ConnectionKeepAlive { get; set; }
|
|
|
|
public bool ConnectionKeepAlive { get; set; }
|
|
|
|
public TimeSpan RateLimit { get; set; }
|
|
|
|
public TimeSpan RateLimit { get; set; }
|
|
|
|
public bool LogResponseContent { get; set; }
|
|
|
|
public bool LogResponseContent { get; set; }
|
|
|
|
public NetworkCredential NetworkCredential { get; set; }
|
|
|
|
public ICredentials NetworkCredential { get; set; }
|
|
|
|
public Dictionary<string, string> Cookies { get; private set; }
|
|
|
|
public Dictionary<string, string> Cookies { get; private set; }
|
|
|
|
public List<HttpFormData> FormData { get; private set; }
|
|
|
|
public List<HttpFormData> FormData { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
public Action<HttpRequest> PostProcess { get; set; }
|
|
|
|
public Action<HttpRequest> PostProcess { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public HttpRequestBuilder(string baseUrl)
|
|
|
|
public HttpRequestBuilder(string baseUrl)
|
|
|
@ -105,13 +104,7 @@ namespace NzbDrone.Common.Http
|
|
|
|
request.ConnectionKeepAlive = ConnectionKeepAlive;
|
|
|
|
request.ConnectionKeepAlive = ConnectionKeepAlive;
|
|
|
|
request.RateLimit = RateLimit;
|
|
|
|
request.RateLimit = RateLimit;
|
|
|
|
request.LogResponseContent = LogResponseContent;
|
|
|
|
request.LogResponseContent = LogResponseContent;
|
|
|
|
|
|
|
|
request.Credentials = NetworkCredential;
|
|
|
|
if (NetworkCredential != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var authInfo = NetworkCredential.UserName + ":" + NetworkCredential.Password;
|
|
|
|
|
|
|
|
authInfo = Convert.ToBase64String(Encoding.GetEncoding("ISO-8859-1").GetBytes(authInfo));
|
|
|
|
|
|
|
|
request.Headers.Set("Authorization", "Basic " + authInfo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var header in Headers)
|
|
|
|
foreach (var header in Headers)
|
|
|
|
{
|
|
|
|
{
|
|
|
|