I use the HttpClient in System.Net.Http to make requests to a web service as below:
using (var client = new HttpClient())
{
using (var response = client.GetAsync(url).Result)
{
var result = response.Content.ReadAsStringAsync().Result;
}
}
I have a sandbox application and a live application. The sandbox application has identical code (in a shared repository) which works fine, but when client.GetAsync(url).Result
is called in the live application, for some reason Fiddler shows me that the requested URL has been encoded which messes the request up.
Requested URL is supposed to look like this:
/advert?paginate=1&page=1&language=en&filters[updated_at][ge]=2016-03-21%2012:19:05
But ends up looking like this:
/advert?paginate=1&page=1&language=en&filters%5Bupdated_at%5D%5Bge%5D=2016-03-21%2012:19:05
Any idea why? Thanks
N.B. Im using the Microsoft.Net.Http library from Nuget in .NET Framework 4.5