Questions tagged [refit]

Refit is a library heavily inspired by Square's Retrofit library, and it turns your REST API into a live interface.

Refit is a .NET library heavily inspired by Square's Retrofit library (JAVA), and it turns your REST API into a live interface. Read more on refit at Github.

204 questions
0
votes
0 answers

Refit: Response status code does not indicate success: 500

I want to send the following two requests to a test environment via Refit. The bottom card generation request works through refit, but the top request does not. I'm getting the below error and no matter what I did I couldn't get past it. //The…
0
votes
0 answers

How to use HttpCompletionOption.ResponseHeadersRead for all Refit request

In regard to HttpClient.Timeout I can't configure only connection timeout to establishing connection but I can set up HttpCompletionOption to every request. It will be then timeout until receiving headers. The only drawback is when I use Refit…
0
votes
1 answer

.NET 4.8.1 setting connection timeout in HttpClient with Refit

How to set connection timeout for Refit? The request may take for example 1 minute but I want to set timeout until the connection is established(30 secs max).
0
votes
1 answer

Parse weird response with refit

I have an API response which is an array containing an object and an array like below: [ { "questions": [ { "type": 3 }, { "type": 7 } ] }, [] ] I tried parsing like this but got no luck: public…
manaclan
  • 816
  • 9
  • 20
0
votes
0 answers

How do I use dependency injection and a jwt token with refit?

I cannot find any examples of using dependency injection with Refit and passing in Jwts per request... or any other way that's not a single hard-coded value in the program.cs…
user3953989
  • 1,844
  • 3
  • 25
  • 56
0
votes
0 answers

ASP.NET Core model binding fails for DateTime or DateOnly types

In my ASP.NET Core 6.0 api project, I have this endpoint in the controller: [HttpGet("Customers/{DateOfBirth}")] Task GetCustomers([FromRoute] DateTime? dateOfBirth, CancellationToken token){....} I'm calling that endpoint with a…
Stack Undefined
  • 1,050
  • 1
  • 14
  • 23
0
votes
1 answer

Refit XmlContentSerializer isn't found when making .net 6 console app

I have a .net 6 console application. I have included Refit v 6.3.2, but when I have: using Refit; var settings = new RefitSettings { ContentSerializer = new XmlContentSerializer() } It says XmlContentSerializer can't be found. The suggestions…
user441521
  • 6,942
  • 23
  • 88
  • 160
0
votes
1 answer

How to re-register refit handlers in MAUI

In my MAUI, I register custom auth handlers using the following code snippet. public static class MauiProgram { public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder …
Ramaraj T
  • 5,184
  • 4
  • 35
  • 68
0
votes
2 answers

Getting 0 lengh file using Refit

I am trying to upload file from desktop client to server using api. In our project, we are using Refit to create api. I am trying to implement it according to Refit manual. https://github.com/reactiveui/refit#multipart-uploads This is Api interface…
0
votes
0 answers

How to update cookie when refreshing the access token in Blazor server-side?

In my app, I use OpenIdConnect to connect to the authorization server and is set up in Startup.cs as follows: services.AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options => { options.Authority = authority; options.ClientId…
Ivan-Mark Debono
  • 15,500
  • 29
  • 132
  • 263
0
votes
0 answers

Refit requires Body(BodySerializationMethod.UrlEncoded]) but not required with httpclient

I have encountered an issue with refit that took few hours to work out on why calls using refit would result in 403 forbidden whilst using httpclient is fine. This happens on some servers but not on others. To Make it work I had to use…
0
votes
0 answers

Refit c# + Firestore rules : How to set the "Request.Data" dictionary on Refit

Summary: I am using Refit to do Api Rest calls to my firestore database. Problem is I have setup rules and it looks like the 'request.resource.data' dictionary of my request is not defined. My condition in the firestore rule tab is: see UPDATE part…
Nearon
  • 71
  • 5
0
votes
0 answers

Problem with json deserialization using refit

I'm using Refit in a project and i am trying to deserialize a json file which is not 'normalized' so to speak. Here is the link to view an example, you can use ids 1491710 or 254700. Json Example from Steam The problem is that the object that is in…
Bazz
  • 35
  • 1
  • 9
0
votes
1 answer

PATCH to a Firestore cloud Database + Refit, Update single field (c#, wpf)

I am trying to update a single attribute of a Firebase document. I am using Refit (c#, wpf) [Patch("/projects/super-project-name/databases/(default)/documents/users/{userId}?updateMask.fieldPaths=licence")] public Task…
Nearon
  • 71
  • 5
0
votes
1 answer

C# Refit Client via Blazor - How to upload a file?

I'm trying to use the Refit library to post a file to my backend using these instructions But I have not been able to make this work. I found this issue which seems to indicate the same thing I'm doing, but it didn't help:…
DLeh
  • 23,806
  • 16
  • 84
  • 128