FAQ Database Discussion Community


The type or namespace Http does not exist in the the namespace Flurl

c#,.net,portable-class-library,flurl
Starting a new Portable Class Library project, I've added the Flurl.Http NuGet package, which appears to have also brought down all it's dependancies, as expected. However when I add the using Flurl.Http directive and some simple code such as using System.Threading.Tasks; using Flurl; using Flurl.Http; public class ClientRepository { public...

How to do XML POST with FlUrl

c#,c#-5.0,dotnet-httpclient,flurl
FlUrl does a great job in dealing with Json/UrlEncoded requests. However, the documentation doesn't really point out how to handle other request types such as text/xml. What's the best way to do an XML POST using FlUrl? This (accessing underlying HttpClient) kinda defeats the purpose of using FlUrl since you...

Can't set Content-Type header

c#,windows-phone-8.1,httpclient,flurl
I'm having trouble setting the Content-Type on HttpClient. I followed along this question: How do you set the Content-Type header for an HttpClient request? But still no luck. String rcString = JsonConvert.SerializeObject(new RoadsmartChecks() { userguid = user_guid, coords = coordinates, radius = (radius * 100) + "" }, ROADSMART_JSON_FORMAT, JSONNET_SETTINGS);...

How to preserve headers in the Flurl HttpClient

portable-class-library,dotnet-httpclient,flurl
I'm using the Furl.Http wrapper over the .NET Http Client. With each request my API requires a User-Agent and an Authorization header to be sent. I would like to set that up once, rather than having to state that every time. What I thought I would be able to do...