271 questions
5
votes
1
answer
2k
views
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/...
1
vote
1
answer
1k
views
Flurl throws an exception (MoveNext())
I am attempting to call a Web API POST action (.Net Core) from a WinForms app (.Net Framework 4.7) via Flurl. However, when I try to debug the exception Flurl throws, my request doesn't even enter the ...
2
votes
1
answer
472
views
Is there autogenerated code for Flurl using swagger.json?
There are some client generators (eg. Postman, Swagger-codegen https://editor.swagger.io/) that uses libraries such as Restsharp to automatically generate classes for a given swagger.json from an API.
...
0
votes
1
answer
938
views
Flurl Proxy after construction?
I'm using Flurl to consume an API in my application and I have a question about proxies. The thing is that I want the user to be able to set the proxy if necessary after startup, is that possible ...
0
votes
1
answer
889
views
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 { ...
8
votes
1
answer
11k
views
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?...
0
votes
0
answers
116
views
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 ...
5
votes
2
answers
2k
views
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,
...
1
vote
1
answer
312
views
Flurl & xUnit doesn't Catch Exception using await
I'm setting up a consumer for a WebAPI and writing some unit tests. The 'act' portion of my test is as follows:
var dta = await service.AuthenticateAsync(customerId, userName, password, machineId); ...
-1
votes
2
answers
1k
views
DownloadFileAsync throw Get TimeOut exception
I have put Flurl in high load using DownloadFileAsync method to download files in private network from one server to another and after several hours the method starts to throw exceptions "Get TimeOut"....
1
vote
1
answer
1k
views
Specifying content language for JSON request with Flurl?
Issue
I would like to POST a JSON request using Flurl with the content header Content-Language specified. I already managed to set the content type (Content-Type) without any issues:
string response ...
0
votes
1
answer
503
views
What should TResult be when using public async Task to return json response from API HTTP Post
Account Service:
public async Task<string> PostRegistrationToApi(NameValueCollection form)
try
{
string str = await url.WithHeaders(new { Accept = "application /json"...
2
votes
2
answers
646
views
How to access ExpandoObject properties using F#?
I am using the Flurl library to call a webservice, which returns a JSON
{"data":{"charges":[{"code":30200757,"reference":"","dueDate":"...
0
votes
1
answer
682
views
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<T> Request<T>(IFlurlRequest flurlRequest)
{
try
{
...
0
votes
1
answer
604
views
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 ...
1
vote
1
answer
25
views
Control by response content type?
I've been handed an API that is not pretty ... i.e. it always returns a 200 but Content-Type: application/pdf when successful and Content-Type: application/text with some json in the body when it is ...
0
votes
1
answer
2k
views
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 ...
3
votes
2
answers
2k
views
Flurl Extension for multi-part Put
I have a Flurl implementation already working for multi-part Posts (json plus file attachment). I need to add an extension for Put that works the same way.
So far I've failed to replicate one.
My ...
0
votes
0
answers
738
views
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 ...
1
vote
1
answer
120
views
Using custom protocol
I would like to use another protocol than http(s):// in particular i want to build a URL that begins with vrchat:// but for some reason it always kills the second /
var url = "vrchat://"....
2
votes
1
answer
1k
views
Flurl PostUrlEncoded does GET instead of POST
I must be missing something very obvious, but I can't tell what. I have a DoLoginAsync like so:
private async Task DoLoginAsync(bool force = false)
{
try
{
...
2
votes
1
answer
2k
views
What is the behavior of FlurlClient with simultaneous requests?
As far as I know, in HTTP 1.1 you can use the same TCP/IP connection for multiple requests, but you can't execute more than one request at a time on that connection. In other words, it has to go like: ...
1
vote
1
answer
3k
views
Remove/ignore ServicePointManager.SecurityProtocol on HTTP requests
I am working on a C# .NET application that requires communication with different services on different servers. I have no part on the server's configuration, so I have to work with the security ...
0
votes
1
answer
724
views
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 ...
12
votes
1
answer
6k
views
How can I use proxies for web requests in Flurl?
I have a simple post request using the Flurl client, and I was wondering how to make this request using a proxy using information like the IP, port, username, and password.
string result = await atc....