Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make http streaming work with Win8 client.

  • Loading branch information...
commit a61ee958edcc34a5b7c20ea0a1063f5170a14f03 1 parent 6d17b00
@davidfowl davidfowl authored
View
10 SignalR.Client.WinRT/Http/DefaultHttpClient.cs
@@ -14,7 +14,7 @@ public class DefaultHttpClient : IHttpClient
var cts = new CancellationTokenSource();
var handler = new DefaultHttpHandler(prepareRequest, cts.Cancel);
var client = new HttpClient(handler);
- HttpResponseMessage responseMessage = await client.GetAsync(url, cts.Token);
+ HttpResponseMessage responseMessage = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead, cts.Token);
return new HttpResponseMessageWrapper(responseMessage);
}
@@ -23,18 +23,18 @@ public class DefaultHttpClient : IHttpClient
var cts = new CancellationTokenSource();
var handler = new DefaultHttpHandler(prepareRequest, cts.Cancel);
var client = new HttpClient(handler);
+ var req = new HttpRequestMessage(HttpMethod.Post, url);
- HttpContent content = null;
if (postData == null)
{
- content = new StringContent(String.Empty);
+ req.Content = new StringContent(String.Empty);
}
else
{
- content = new FormUrlEncodedContent(postData);
+ req.Content = new FormUrlEncodedContent(postData);
}
- HttpResponseMessage responseMessage = await client.PostAsync(url, content, cts.Token);
+ HttpResponseMessage responseMessage = await client.SendAsync(req, HttpCompletionOption.ResponseHeadersRead, cts.Token);
return new HttpResponseMessageWrapper(responseMessage);
}
}
View
4 SignalR.Client/Connection.cs
@@ -179,12 +179,8 @@ public Task Start()
/// <returns>A task that represents when the connection has started.</returns>
public Task Start(IHttpClient httpClient)
{
-#if NETFX_CORE
- return Start(new LongPollingTransport(httpClient));
-#else
// Pick the best transport supported by the client
return Start(new AutoTransport(httpClient));
-#endif
}
/// <summary>
Please sign in to comment.
Something went wrong with that request. Please try again.