Questions tagged [flurl]

Flurl is a fluent URL builder and wrist-friendly HTTP client library for .NET.

Flurl is a modern, fluent, asynchronous, testable, portable, buzzword-laden URL builder and HTTP client library for .NET.

With a discoverable API, extensibility at every turn, and a nifty set of testing features, Flurl is intended to make building and calling URLs easy and downright fun.

Flurl is available on NuGet in two flavors:

  • Flurl.Http includes all features.
  • Flurl for just the URL builder functionality without the HTTP features.
255 questions
0
votes
0 answers

How to use Flurl with Polly without factory

Following from Set a default Polly policy with Flurl How do I use Polly with Flurl without the factory? This only calls it once string s = await Policy .Handle () .OrResult…
Robin
  • 451
  • 3
  • 14
0
votes
1 answer

Flurl.Http PostMultipartAsync caused some errors

I'm posting some data to a server. This piece of code works fine a few months ago. But now it threw “Flurl.Http.FlurlHttpException”. Flurl.Http 2.3.2 string res = ""; try { var obj = new { api_key = "key", api_secret = "secret", start = 1 }; …
Vincent
  • 3,124
  • 3
  • 21
  • 40
0
votes
1 answer

How to send a notification to the OneSignal API with flurl

I'm trying to send some data using the example in the page of onesignal var request = WebRequest.Create("https://onesignal.com/api/v1/notifications") as HttpWebRequest; request.KeepAlive = true; request.Method = "POST"; request.ContentType =…
0
votes
0 answers

Error getting value from 'CheckCertificateRevocationList' on 'System.Net.Http.HttpClientHandler'

I'm getting this on my production server, but not my develop or test machines. I'm having a hard time understanding what is wrong here. Error getting value from 'CheckCertificateRevocationList' on 'System.Net.Http.HttpClientHandler'. at…
devzero
  • 2,510
  • 4
  • 35
  • 55
0
votes
0 answers

How do I set the Connection header properly?

I am mirroring another request so I have an array with all the headers. I add each of them with "url".WithHeaders(headersDictionary). But when I test the request I get a second value in the Connection header. The request is made like this: req =…
beppe9000
  • 1,056
  • 1
  • 13
  • 28
0
votes
1 answer

How to Assert for Response Code for request using flurl

I was trying to put an assert for Response Code for my request, but i am having hard time to figure out, could you please help me on this. Here is my implementation and definition. myTests.cs var accessToken = await…
Kal
  • 3
  • 3
0
votes
1 answer

What should TResult be when using public async Task to return json response from API HTTP Post

Account Service: public async Task PostRegistrationToApi(NameValueCollection form) try { string str = await url.WithHeaders(new { Accept = "application /json", User_Agent = "Flurl"…
Code Dog
  • 3
  • 1
0
votes
1 answer

Mocking IFlurl library methods using NSubstitute is throwing null reference exception

I am using flurl and I am trying to unit test the code below: public class MyRestClient { public async Task Request(IFlurlRequest flurlRequest) { try { return await flurlRequest …
boywonder
  • 116
  • 2
  • 11
0
votes
1 answer

How to get Flurl to ignore JSON hijack prevention

I am trying to consume a JSON API using Flurl If I use .GetStringAsync() the API returns as follows: {} && {identifier:'ID', label:'As at 15-11-2018 6:25 PM',items:[...]} However, when I try .GetJsonAsync() the properties are all null, I…
Shevek
  • 3,869
  • 5
  • 43
  • 63
0
votes
1 answer

Web api call returns json data with empty fields

I'm getting some json data using Flurl (function below). My problem is that this returns the expected fields but not the actual data: The json is at: https://jsonplaceholder.typicode.com/users The exact same function worked fine in a separate…
F. Dawson
  • 3
  • 3
0
votes
1 answer

Dealing with double-encoding in Flurl http get requests

Am having a bit of trouble understanding how to pass encoded data in a request using flurl. We have an api that looks like: https://servicename.com/domain/api/{identifier}?parameter=value And in some specific cases we have identifiers which contain…
The Aurochs
  • 103
  • 3
0
votes
0 answers

Can't POST attachment through Flurl Error 411 Length Required

Can someone explain what I'm doing wrong here? I'm specifying the length header. No idea why its saying "Length Required". This request works fine when I send it through Postman, but fails when I send it through Flurl in C#. Heres the API docs for…
Rilcon42
  • 9,584
  • 18
  • 83
  • 167
0
votes
1 answer

HttpClientHandler RFC 7616 Digest Authentication Header Using Wrong Uri

I'm trying to access a resource on a Lighttpd server which enforces that the full request URI matches the URI in the Authorization request header. This is specified in RFC 7616 The authenticating server MUST assure that the resource designated by…
FinalFortune
  • 635
  • 10
  • 25
0
votes
1 answer

Flurl compatibility to .net core 2.1

In .NET Core 2.1 there is HttpClient completly rewritten. There were many imporvements like it uses websockets and etc now. It also fixes concurrency problems. I want to ask if FLurl utilizes new .NET core HttpClient or uses olderone? If older one…
0
votes
1 answer

Using Flurl.Http, is there a way to determine the number of bytes sent?

I would like to know how many bytes were actually transmitted when using Post or PostAsync. I'm using code similar to the following. I could look at the bytes of the filePath, but in my real code, I'm doing some manipulation to the file stream…
101010
  • 14,866
  • 30
  • 95
  • 172