using (var http = new HttpClient(mockHandler))
using (var apiConnection = new TwitterApiConnection("", ""))
{
- apiConnection.http = http;
+ apiConnection.httpUpload = http;
using (var image = TestUtils.CreateDummyImage())
using (var media = new MemoryImageMediaItem(image))
using (var http = new HttpClient(mockHandler))
using (var apiConnection = new TwitterApiConnection("", ""))
{
- apiConnection.http = http;
+ apiConnection.httpUpload = http;
mockHandler.Enqueue(async x =>
{
public string AccessSecret { get; }
internal HttpClient http;
+ internal HttpClient httpUpload;
internal HttpClient httpStreaming;
public TwitterApiConnection(string accessToken, string accessSecret)
{
this.http = InitializeHttpClient(this.AccessToken, this.AccessSecret);
+ this.httpUpload = InitializeHttpClient(this.AccessToken, this.AccessSecret);
+ this.httpUpload.Timeout = TimeSpan.FromMinutes(1);
+
this.httpStreaming = InitializeHttpClient(this.AccessToken, this.AccessSecret, disableGzip: true);
this.httpStreaming.Timeout = Timeout.InfiniteTimeSpan;
}
HttpResponseMessage response = null;
try
{
- response = await this.http.SendAsync(request, HttpCompletionOption.ResponseHeadersRead)
+ response = await this.httpUpload.SendAsync(request, HttpCompletionOption.ResponseHeadersRead)
.ConfigureAwait(false);
await this.CheckStatusCode(response)