271 questions
0
votes
0
answers
44
views
How can I use Service Discovery and Flurl together?
I am using Aspire and have two services, we'll call them api, and mockapi.
I have the two setup as follows with Aspire
var mockapi = builder.AddProject<Projects.MockApi>("mockapi");
...
0
votes
0
answers
29
views
FlUrl AcquireToken before each request - MSAL authentication
I am using MSAL to acquire a token from AzureAD, and then I will use this token for every FlUrl call.
To keep the MSAL token auto-refresh working, I need to call MSAL's AcquireToken before every FlUrl ...
0
votes
0
answers
47
views
Client call hands while doing loading tests
I have a very complex solution, written in C#/.NET 6, composed by Azure Service Triggers that use an API running as an Azure HTTP Trigger.
There are 4 trigger function, each running up to 30 parallel ...
0
votes
1
answer
97
views
How to provide a custom HttpClient for a per-host FlurlClient
If I'm using the short-form fluent APIs of flurl ("some-url/whatever".GetAsync()), how do I explicitly configure the HttpClient per-host?
I've looked at the documentation, but ...
0
votes
1
answer
82
views
Reverse proxy in ASP.NET Core: how to return the HTTP status code from destination server?
I'm using ASP.NET Core and Flurl to write a reverse proxy that sends requests to one destination server, another server, or both, depending on how the reverse proxy is configured at runtime. I want ...
0
votes
1
answer
119
views
Remove Accept-Encoding Header in Flurl.Http
Flurl.Http sends in every Request the following Header:
Accept-Encoding: gzip, deflate
This behaviour is since Update to Version 4.
I would contact API, which returns Error 406 when i send a request ...
0
votes
1
answer
87
views
Why is the Json deserializer not working?
I'm quite new to Json files and Blazor, and I was trying to deserialize a Json string, but when I try to fill a list with objects obtained via deserializer the list is full of null objects.
I'm also ...
0
votes
2
answers
281
views
How to register multiple Flurl clients in DI container?
Flurl documentation says that the recommended approach for Flurl clients using DI is to utilize this registration pattern:
// at service registration:
services.AddSingleton<IFlurlClientCache>(sp ...
0
votes
0
answers
394
views
How to move away from CustomHttpClientFactory in Flurl 4.0?
What we have implemented currently is something like this: https://v3.flurl.dev/docs/configuration/#httpclientfactory with the CustomHttpClientFactory being a BearerTokenManagingHttpClientFactory ...
2
votes
1
answer
2k
views
FLURL 4.0 use Newtonsoft JSON Serializer on a single request
Referencing Flurl Serializers it shows that Flurl 4.0 can use the Newtonsoft based serializer, but it is not clear to me how to do this for a single request. I need this to address a circular loop ...
-1
votes
1
answer
142
views
How to correctly handle a 204 Response in Flurl
I am working with the Audiocodes SBC API which returns for example when no Alarms are available a 204 as response. This leads to FLurl GetJsonAsync request returning null. The problem now is how would ...
1
vote
1
answer
784
views
FlUrl 4.0: how to work with WithOAuthBearerToken and dependency container
In FlUrl version 3.X, I have been working with my REST Api in this way:
I have the singleton instance _noAuthClient. With this client, I make a Login call to Rest Api, which returns JWT token.
Then I ...
0
votes
1
answer
172
views
Is there a way to write an HTTP request and then execute it at a later time using Flurl?
I am trying to write a Flurl HTTP request that will be executed at a later time.
Here is what I would like to do (C# code):
public async void SomeFunction(string url, object someJson, object ...
0
votes
1
answer
546
views
Redirect (302) between endpoints of controller in Blazor WebAssembly Hosted project using IFlurlClient
I am dealing with an issue regarding redirecting in server controller in hosted Blazor WebAssembly project.
As an example, I modified default WeatherForecastController to redirect one endpoint to ...
0
votes
0
answers
468
views
Timeout issue when communicating with API in C# application
I have a C# application that communicates with an API. I'm encountering a timeout issue when making requests to the API. The specific error message I'm receiving is:
---> Flurl.Http....
1
vote
1
answer
188
views
Why is Flurl response empty when fetching lyricsify.com?
I want to use Flurl to query lyricsify.com
but I always get an empty string as result.
With Insomnia, Powershell and other tools, I get the HTML response as expected.
[Fact]
public async void ...
0
votes
1
answer
313
views
With flurl how can I pass multiple URL encoded form values with the same key?
I would like to replicate the following curl request where I pass in multiple form parameters with the same key, but using flurl in C#.
curl -X POST \
https://example.com \
--data "...
0
votes
0
answers
278
views
Flurl/HttpClient messes up memory on simultaneous requests using IoC
We are using Flurl to upload many files at once in our Web API app (.net 6). Usually, from 20 to 30 simultaneous uploads are executed.
I am trying to manage Flurl instances explicitly and use IoC. The ...
-1
votes
2
answers
164
views
Turning multiple json string of same type into List<T> C#
Hey im working on a litle project right now and i need to turn a list of json string into List<TaskStruct.cs>
I have included all the needed code if something is missing let me know!
im getting ...
0
votes
0
answers
670
views
Basic authorization fails when using Flurl
In an api demo, WebClient authenticates correctly when set like this
client.Headers["authorization"] = $"Basic Njk4NzYzNTc6dGVzdHBhc3N3b33JkX0RFTU9QUklWQVRFS0VZMjNHNDQ3NXpYWlEyVUE1eDdN&...
0
votes
0
answers
306
views
Flurl Posting with C#
Good moring Team,
Since yersterday im trying to post an API using Flurl but im still getting this error and the post code block is not executed, i dont know where should be the issue.
bellow is my ...
0
votes
1
answer
683
views
How to set up a proxy server for a flurl client selectively?
Is there a recommended way of defining a proxy for flurl clients based on the URL (or base URL)? I could not find anything in the documentation and discussions of the topic I did find (such as Setting ...
0
votes
0
answers
270
views
Is it possible to download a .txt file and manipulate said file in one endpoint using ASP.NET MVC controller?
My task is to download a .txt file, remove some of the data and save it as .json. Currently I use one interface to download a file as .txt file and another interface to read all lines of said file, ...
0
votes
3
answers
941
views
Using Moq and IFlurlClientFactory and IFlurlClient
I have a question on how to test / mock out the IFlurlClientFactory and IFlurlClient.
I'm registering my service (as a singleton eventually via DI), which uses the IFlurlClientFactory in a following ...
0
votes
1
answer
364
views
Close Flurl connection asap on POST
How to close the connection asap when requests finish? Does Flurl close connection automatically on FlurResponse Dispose?
var fileContent = new FileContent("myfile");
using (var result = ...