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

Refit response is null even though JsonSerializer works

I am having trouble deserializing a json response. I am using the Refit c# library to communicate with the API. The RootObject.company in response is always null, even though the test field is loaded correctly. I also tried retrieving the JSON…
Luk164
  • 657
  • 8
  • 22
2
votes
0 answers

How replace IServiceCollection extension methods in Autofac?

I'm building an application with ASP.Net Core 2.1 and I'm using autofac instead the built-in DI container. Now I have a doubt: if I have a library that provides extension methods for IServiceCollection, how can I use it in autofac? In my case I…
2
votes
1 answer

Set JSON Naming Convention for Refit client

I'm trying to use the Refit library (https://github.com/reactiveui/refit) to create an http client for my service, but there was a problem. I want to use SystemTextJsonContentSerializer for serialization and set the naming convention of json object…
kaboom
  • 41
  • 5
2
votes
1 answer

C# - Web Api pass object using Refit

Hello guys I'am currently working in Xamarin and got stucked with basic operation. Iam trying to call my NetCore web API from Xamarin using Refit. The main problem is - I guess - that i want to pass object in paramater of call. The second problem…
parysoid
  • 87
  • 8
2
votes
0 answers

Is there any alternative of Refit to support sync methods

since I have a project in which I am not using Async, I have searched about Refit alternative for Synchronous type-safe RestApi call but not found anything please anyone can give any idea or suggestion which one I can use.
2
votes
2 answers

Add a dynamic header to all outgoing Refit requests

I am using Refit (5.1.67) as my HttpClient wrapper, in a .NET Core 3.1 app using IHttpClientFactory. The API I am calling is secured using a client credentials token. I am registering the client with…
Rob King
  • 1,131
  • 14
  • 20
2
votes
1 answer

Refit 5.0 with Uno Platform fails with "MissingMethodException"

I have it working perfectly with the UWP application but as soon as I try run the Droid version I get the following error :- Error Generation failed: System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException:…
George Bamber
  • 25
  • 2
  • 2
2
votes
1 answer

Refit Net core AddRefitClient Read Response Header

I need help with the below code for a WPF .net core 3.1 app which uses Refit for handing REST APIs. I am trying to get the value of the AuthToken from the response header. But I can't find a property holds the value of the…
2
votes
1 answer

Check raw response in ApiResponse

In Refit, is there anyway to get the raw HTTP response in ApiResponse object? In my case, if response code is 200, it returns type Person. If the response code is 201, it returns with an Error response. I want to be able to deserialize the HTTP…
Jerry Ren
  • 41
  • 1
  • 6
2
votes
2 answers

How to set a custom JSON Serializer in Refit

Currently the API response includes two top level attributes which are of no use to my need. a: { b: { c: [ data: whichINeed ] } } If I create models for this I would have unncessary root objects which I want…
user5381191
  • 611
  • 7
  • 21
2
votes
2 answers

task oncomplete is not moving on

I need to go to the next activity when a task is completed but it won't. It successfully makes an account in the database but won't move on. As seen below I've tried oncomplete(task) but once I enter credentials and hit register it creates the…
2
votes
1 answer

How to implement cross validation (on rolling forecasting origin) using ARIMA?

Suppose that I have a time-series dataset using 90% as training set and 10% as a random validation set. How do I evaluate the accuracy of an ARIMA model? Do I have to fit the ARIMA model with auto.arima using the 100% of the full dataset and…
Huy Huynh
  • 21
  • 1
  • 3
2
votes
1 answer

How do I serialize my class to send it as urlencoded with refit

Hi there I'm trying to send a POST method with refit, using postman so far I can say it's working, if I send the data with the x-www-form-encoded option, the json I send looks like this { "apt": "APT", "apartment": "A103", "author":…
Herb
  • 119
  • 2
  • 16
2
votes
0 answers

Refit inheritance misses methods

We use Refit for our API declarations and want to use Interface inheritance. A sample is shown here: https://github.com/reactiveui/refit#interface-inheritance public interface IPlatformRestClient { HttpClient Client { get; } …
Benjamin Abt
  • 1,730
  • 18
  • 33
2
votes
2 answers

Refit not working (Github API)

I am trying to figure out how to use the Refit library to make GET requests but I do not know why it is not working. I am following the example on the refit github page. What am I missing? It seems like the GetUser("octocat") method is not working.…
Ownage
  • 45
  • 4