Sep 22, 2016 at 1:38 PM
Edited Sep 22, 2016 at 2:12 PM
we didn't hear a Long time, sorry I was very busy :-)
I hope you are well!
I am still using the older Version of the rtp Client, didn't have the time to try the new one, sorry.
but it works good with the older one, too.
One question please:
I have to add some web requests to my app. I have Problems with Android when I am using the System.Net.Httpclient there. A fallback with System.Net.WebRequest has the same Problems.
On iOS it works fine, on Android it works sometimes, but other times it does strange stuff like changing the endpoint etc when Requests are sent.
So I would like to try your HTTPclient, because your stuff works good :-)
I start with a string uri, a username and a Password. The uri Looks like this
The username and password are used for credentials.
I try to return into a HttpResponseMessage, because the old function did use it and I do not want to Change all the calling functions.
Right now as Response I get a "Bad Request", I think I messed up the pieces of the uri...
So I try with your class, I am not sure which part belongs to the Parameter in the new httpClient and which part exactly belongs :
private static async Task<HttpResponseMessage> getAsyncTest(String uri, String username, String password)
Uri u = new Uri(uri);
using (Media.Http.HttpClient httpClient = new Media.Http.HttpClient("http://"+u.Authority))
httpClient.Credential = new NetworkCredential(username, password);
using (Media.Http.HttpMessage httpMessage = new Media.Http.HttpMessage(Media.Http.HttpMessageType.Request))
httpMessage.MethodString = u.AbsolutePath;
bool useClientProtocolVersion = false, hasResponse = true;
int maxAttempts = 0;
//needed? httpClient.ProtocolVersion = 1.1;
// httpMessage.Version = 1.2;
using (Media.Http.HttpMessage httpResponse = httpClient.SendHttpMessage(httpMessage, out error, useClientProtocolVersion, hasResponse, maxAttempts))
var response = new HttpResponseMessage(HttpStatusCode.OK);
response.Content = new StringContent(httpResponse.Body);
catch (Exception @_)