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

Polly FallbackPolicy with Refit and HttpClientFactory

I use the HttpClientFactory together with Refit to make API calls. I want to use Polly for Retry, Circuit Breaker and Fallback, and while it's easy to set up Retry and Circuit Breaker, I struggle with Fallback, as it can only return a fallback value…
Bjoern
  • 433
  • 3
  • 16
-1
votes
1 answer

Retry Refit request with Polly only on condition

I set up the following service collection with a Refit client and a Polly policy for dependency injection in my UWP app: var serviceCollection = new ServiceCollection(); serviceCollection .AddRefitClient(typeof(IClassevivaAPI)) …
Gabboxl
  • 91
  • 3
  • 16
-1
votes
1 answer

HttpRequestException in IIS Admin API

I want to edit the large file (Size ~ 50 MB) via Microsoft IIS Admin API and mentioned is the official documentation link (https://learn.microsoft.com/en-us/iis-administration/api/files#manipulating-file-content-apifilescontent). Microsoft IIS Admin…
Atif
  • 248
  • 1
  • 3
  • 11
-1
votes
2 answers

C# Refit Multipart Content stays blank

I'm new to C# and Refit and I encountered an issue I can't solve. I need to convert the following CURL request to Refit (It must be refit) curl -X 'POST' \ 'https://www.hybrid-analysis.com/api/v2/quick-scan/file' \ -H 'accept: application/json'…
-1
votes
1 answer

Cannot upload photo with refit using Net Core

I try to Upload a photo from web MVC to API by refit but alway return 400 bad request and data send from client is null These are my codes: //Refit [Multipart] [Post("/api/products/{id}/uploadphoto")] public Task> UploadPhoto(int…
yohhhh
  • 1
-1
votes
1 answer

Refit : How to throw ApiException purposefully for specific status codes

I'm trying to create Refit library for my APIs. I wanted to throw ApiExeption whenever status code received is other than 200 and 207. public interface IServiceAPIs{ [Post("/api/users/register")] Task
-1
votes
1 answer

Polly - Policy Handler which evaluates transient failures from HTTP response content

I'm using Refit, with Polly and Polly.Extensions.Http in an ASP.NET Core Web API to call some external APIs. I'm trying to add a policy handler using Polly which can retry depending on the body content as the external API I am working with, doesn't…
xceled
  • 1
  • 1
-1
votes
1 answer

Deserialize JSON object into dynamic object

I have a json object I'm not able to deserialize. The json object comes from Alpaca Markets api/snapshots. I'm using Refit, but able to create a class set to read this, so I have read the json object directly, but are not able to reserialze this…
-1
votes
2 answers

Refit with TestServer and NSubstitute

I am trying to use Refit to test a Rest interface on TestServer, while replacing the DateTime.Now to return custom time. My refit interface looks something like this: public interface IMyApi { DateTime CurentTime(); …
Will I Am
  • 2,614
  • 3
  • 35
  • 61
1 2 3
13
14