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
7
votes
1 answer

Parsing from JSON to object using Flurl

I'm using Flurl to get a JSON response from the TVDB API. I have this class( dumbed down for now, just trying to get the seriesNames): public class Show { public string seriesName; } And I'm using Flurl like this: dynamic test = await…
Jrow
  • 1,026
  • 2
  • 12
  • 31
7
votes
2 answers

C# Flurl and HttpClient, no response from REST API

I am having a problem with getting a response from an API with my code, the request does not time out and it does not give me a response at all. I have made an api endpoint in my own API to return the json string to then manually post the json data…
Miwca
  • 121
  • 1
  • 8
6
votes
1 answer

POST JSON with Flurl

I start with Flurl and I would like to create a POST but I think I have a problem with the format of my JSON parameters. You can see the JSON parameters: { "aaaUser" : { "attributes" : { "name" : "device:domain\\login", "pwd"…
Digitag
  • 235
  • 3
  • 5
  • 11
6
votes
1 answer

Getting back cookies from the request in Flurl.Http v2.0.1

When using Flurl.Http v1.2 we had the following code: 1. var cookieJar = new CookieContainer(); 2. var url = baseUrl.AppendPathSegment("api/auth/login"); 3. var client = url.EnableCookies(); 4.…
Craig W.
  • 17,838
  • 6
  • 49
  • 82
6
votes
1 answer

FLURL: mapping property names

Is there any way to map non-matching property names when doing ReceiveJson()? For example 'user_name' in JSON should map to 'UserName' in C# object. List people = await _settings.Url .AppendPathSegment("people") .GetAsync() …
Aetherix
  • 2,150
  • 3
  • 24
  • 44
6
votes
5 answers

How to change the HTTP Request Content Type for FLURL Client?

I am using flurl to submit HTTP request and this is very useful. Now I need to change the "Content-Type" header for some of the requests to "application/json;odata=verbose" public async Task AddJob() { var flurlClient =…
mJay
  • 713
  • 3
  • 11
  • 23
6
votes
3 answers

How to use Polly with Flurl.Http?

Currently I have this request: await url .SetQueryParams(queryString) .SetClaimsToken() .GetJsonAsync() I'd like to start using Polly (https://github.com/App-vNext/Polly) now to handle retries and provide a better user experience.…
eestein
  • 4,914
  • 8
  • 54
  • 93
5
votes
1 answer

Can I Log all requests using Flurl.Http?

Asp.NET core logs each request that enters based on configuration. Now i'd like to have the same functionality for Flurl requests i sent. Most notably, I of course would like to know when a requests fails or does not complete. For debugging I found…
sommmen
  • 6,570
  • 2
  • 30
  • 51
5
votes
1 answer

How to stop outbound HTTP connections from timing out

Backgound: I'm currently hosting an ASP.NET application in Azure with the following specs: ASP .Net Core 2.2 Using Flurl for HTTP requests Kestrel Webserver Docker (Linux - mcr.microsoft.com/dotnet/core/aspnet:2.2 runtime) Azure App Service on…
5
votes
1 answer

how to handle bad request exception in flurl

I am totally new to Flurl.I am trying to call api and i deliberately passed invalid apikey in paramter and then api fails saying "Forbidden" and with error code 403. How can i handle that in Exception? public async Task
James
  • 1,827
  • 5
  • 39
  • 69
5
votes
1 answer

Flurl Array Encoding

I am attempting to post some data that includes a string array to an endpoint but receiving an error "Invalid array" Doing this: .PostUrlEncodedAsync(new { amount = 1000, allowed_source_types = new[] { "card_present" }, …
Stephen McDowell
  • 839
  • 9
  • 21
5
votes
1 answer

Setting a per-request proxy (or rotating proxies) with .NET Flurl/HttpClient

I know that with the Flurl HTTP .NET library I can set a global proxy by using a custom HttpClientFactory, but is there a way to choose a custom proxy for each request? With many other programming languages, setting a proxy is as easy as setting an…
mcont
  • 1,749
  • 1
  • 22
  • 33
5
votes
1 answer

Custom HttpClientHandler using FlurlClient doesn't use ClientCertificate

I need to add a client certificate to my web requests and tried to achieve it in this way: Stackoverflow At the end of this answer the "FlurlClient way" is presented. Using and configuring a FlurlClient instead of a global FlurlHttp configuration.…
d03090
  • 354
  • 1
  • 5
  • 17
5
votes
3 answers

C# HttpClient tor socks4/5 proxy?

I can set http proxy with this code: public class CustomFlurlHttpClient : DefaultHttpClientFactory { public override HttpClient CreateClient(Url url, HttpMessageHandler m) { return base.CreateClient(url,…
abritov
  • 373
  • 4
  • 11
5
votes
1 answer

Posting `multipart/form-data` with Flurl

I am in need to post the following request: POST http://target-host.com/some/endpoint HTTP/1.1 Content-Type: multipart/form-data; boundary="2e3956ac-de47-4cad-90df-05199a7c1f53" Accept-Encoding: gzip, deflate Connection: Keep-Alive Content-Length:…
aignas
  • 1,044
  • 12
  • 19
1
2
3
16 17