refit Questions

4

I have one .Net Core Razor pages app which is trying to call a .Net Core API with a class library created using Refit. I have created one Refit API interface which uses a model with enum as one of ...
Affirm asked 23/8, 2021 at 6:40

4

Currently, I am adding an authorization header to my request like this: File: SomeFile.cs public interface ITestApi { [Get("/api/test/{id}")] Task<string> GetTest([Header("Authorization")...
Pyrostat asked 19/10, 2018 at 7:17

3

I'm using Refit in my C# application to interact with a REST API, and the API method has a call that returns a .jpg image. I want to download this image using Refit and get it as a byte array, but ...
Hillier asked 9/2, 2017 at 15:57

1

Solved

I want to use Refit to query an API. First thing, I need to obtain an access token which is a POST request returning a status 400. I have no idea what causes the problem, thus I would like to see t...
Dorri asked 28/4, 2023 at 15:53

4

I am investigating the refit library and evaluating if I is worth integrating in my project. Let's say I have this Controller that accepts a POST message with a specific contract: [Route("api/[c...
Buryat asked 17/10, 2018 at 15:28

2

Solved

I am using Refit to call an API using a Typed Client in asp.net core 2.2 which is currently bootstrapped using a single BaseAddress from our configuration Options: services.AddRefitClient<IMyAp...
Canea asked 29/10, 2019 at 16:52

4

How do I get to the content of Refit.ApiException? Depending on what the inner content is, I want to let the user know how to proceed. So I see that thrown exception has the following content ... ...
Melanous asked 2/3, 2015 at 20:33

4

I have an application that makes a request for an authenticated service, where it is necessary to pass the access_token. My idea is to use Polly to retry if the access_token is expired. I'm using R...
Boozy asked 18/8, 2020 at 1:36

3

Solved

I'm writing some APIs using Refit, which works wonders, and I'm having some trouble figuring out a good (as in "clean", "proper") way to perform some arbitrary processing on the returned data. As ...
Jacquerie asked 14/1, 2019 at 14:3

3

I use Refit for RestAPI. I need create query strings same api/item?c[]=14&c[]=74 In refit interface I created method [Get("/item")] Task<TendersResponse> GetTenders([AliasAs("c")]List&l...
Overcloud asked 16/11, 2016 at 13:0

1

Solved

There is a way to use Refit to input parameters in a dynamic way? I have this code in my Refit`s Interface: [Get("/click?{parm}")] Task<ApiResponse<TAny>> SaveClick(string p...
Yalu asked 15/1, 2022 at 21:37

3

Solved

I am using Refit library in my Xamarin App, I want to set 10 seconds timeout for the request. Is there any way to do this in refit? Interface: interface IDevice { [Get("/app/device/{id}")] Task...
Agathaagathe asked 10/4, 2017 at 6:0

1

Solved

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": ...
Heater asked 16/9, 2019 at 20:43

1

I'm refactoring my code to use Refit for my calls to the WebApi service. The interface is set up and I also created a delegating handler: public class AuthHandler : DelegatingHandler { private rea...
Septal asked 13/2, 2021 at 14:24

0

I have a little problem with passing Dictionary as part of the parent object as a query parameter. So, I have a method that gets a FormulationParameters variable. public async ValueTask<IActionR...
Karynkaryo asked 29/1, 2021 at 8:47

3

I am using Refit and would like to set both a dynamic AND a static header. For this one specific call I need to set a content-type of application/json (for others, I do not), but I also need to pas...
Dromedary asked 18/4, 2017 at 17:11

1

Solved

I'm using Refit to generate a client for a web service. All the URLs of my Web API are like this: https://service.com/api/v3/datasets?api_key=XXXXXXX As you see, the API key is specified in the...
Versify asked 11/2, 2020 at 17:36

3

I'm having a problem with a Get method in my Web API: The API gets the object but with the default values. For instance: myRefitClient.GetSummary(new MyClass() { Prop = 1 }); The Web API correc...
Zoril asked 21/9, 2017 at 11:28

2

I am using multipart with Refit. I try to upload profile picture for my service the code generated from postman is looking like this var client = new RestClient("http://api.example.com/api/users/1...
Bestialize asked 8/8, 2018 at 18:11

1

I just found out about the Refit library on GitHub (link: https://github.com/reactiveui/refit) . Besides my first steps in this huge world, I tried to understand why the use of this library comes h...
Thereon asked 13/5, 2018 at 18:58

2

Solved

I'm using Refit library for my app and I need to make a call to another service. I need to get all entities with ids that I'm passing. I tried [Body] attribute and it still doesn't work. I manage ...
Frailty asked 8/7, 2019 at 15:48

1

Solved

When I use a POSTMAN to do make a request, my API receives a IList<IFormFile>. How can I do the same request using Xamarin.Forms with REFIT?
Kekkonen asked 14/1, 2018 at 19:47

3

I am using the Refit library with my Xamarin forms project to send API requests. It works great, but have an issue when the access token expires. When the access token expires, I get an 401 error ...
Sanguinolent asked 8/1, 2018 at 11:25

2

Solved

I'm calling a REST service using Refit and I want to deserialize the JSON that is returned as a dynamic type. I tried defining the interface as [Get("/foo")] Task<dynamic> GetFoo(); but ...
Retroact asked 12/9, 2017 at 6:1

2

Solved

I have: public class Query {...} public interface IClient { [Get("/api/endpoint?data={query}")] Task<Result> GetData(Query query); } but Refit on the Query instance calls ToString instea...
Oneal asked 21/11, 2015 at 15:35

© 2022 - 2025 — McMap. All rights reserved.