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
vote
0 answers

Json Serializing extra properties using Refit Post

I am trying to post using Refit and keep getting a 500 error. The Object that I am posting if I JsonConvert.SerializeObject(model) looks fine but when I pass the model into my Refit Interface I get the following: a 275 before and a 0 after the…
jordanpowell88
  • 857
  • 3
  • 11
  • 25
1
vote
1 answer

Error during fetch details from web service in refit xamarin forms

Error: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.ObjectModel.ObservableCollection1[System.Collections.ObjectModel.ObservableCollection1[DynamicLayoutSample.ElementList]]' because the type…
Divya
  • 11
  • 3
1
vote
1 answer

Azure web api call slow on phone but works well on android emulator

I am trying to make a call to my web api using Refit in a Xamarin Forms app and it seems to work well in the emulator (2 - 5 secs) but crashes most times on a real android phone or takes quite long to return on rare occasions. I am using a basic 5…
tribal
  • 219
  • 3
  • 14
1
vote
2 answers

Json.Net serialise collection into named attributes

I am creating a Xamarin app with API calls managed by Refit and other Paul Betts libraries and was looking at serialising a collection of objects into a Json attributed array. The question I have is how do I serialise the collection of MemberSlot…
Phil Murray
  • 6,396
  • 9
  • 45
  • 95
1
vote
2 answers

Azure blob authorization header

I am trying to use refit to upload to azure blob storage from a Xamarin iOS application. This is the interface configuration I am using for Refit: [Headers("x-ms-blob-type: BlockBlob")] [Put("/{fileName}")] Task UploadAsync([Body]byte[]…
doorman
  • 15,707
  • 22
  • 80
  • 145
1
vote
4 answers

Refit Update package on Xamarin

I've just updated a Xamarin solution using the refit package (2.3.0. -> 2.4.1) and now the build is complaining: RefitStubs.g.cs(37,27): error CS0102: The type `Sample.App.Api' already contains a definition for `Client' RefitStubs.cs(37,27):…
amun1000
  • 453
  • 1
  • 8
  • 18
1
vote
1 answer

Android - Refit throws UnknownHostException unexpectedly

I'm trying to implement Refit using Xamarin and for some reason it throws a UnknownHostException (UHExc) if I was previously not connected to wifi while the app was open. This doesn't happen consistently though. I have these two calls to Refit's…
Xerillio
  • 4,855
  • 1
  • 17
  • 28
1
vote
0 answers

Reactive Extensions, Akavache and Refit is too much for Windows Phone's Internal Card

I want to use paulcbetts/refit in my application and akavache/Akavache. Problem is that according to my logic, Windows Phone doesn't like that I do the following: I get semester (from cache, then fetch), pick the wanted semester (I put H2014 for…
1
vote
0 answers

Akavache not working in Windows 8.1 Universal App

I’m trying to make work Akavache in a Windows Universal Application (8.1 for now, using ReactiveUI 6.5). To make sure that it is not related to my architecture, I did an empty solution that has all the necessary packages and requirements (VC++ for…
1
vote
1 answer

Policy Handle issues in conjunction with Refit package and Xamarin

I have set up my Xamarin core project with a lot of the tips I read from here. I have a simple service that I'm using to see if an entered url for a server is valid: IValidateUrlService I'm trying to use the Polly library to do something like…
PkL728
  • 955
  • 8
  • 21
0
votes
0 answers

Using Polly with Refit to retry failed requests based on the response content

I want to retry a query made with Refit. The issue is that Http Response does not have any signs of the error (e.g. status code), but the content itself only. In my flow I have a custom Serializer that can distinguish a correct response and the…
dr11
  • 5,166
  • 11
  • 35
  • 77
0
votes
0 answers

Retrieving access token as a part of the Refit execution flow

I have API similar to this: GET /api/token?key={key} GET /api/data?key={token} GET /api/data2?key={token} Before using any other call, I must query the first request and get the token by the fixed key. Then using the thing token, I can make any…
dr11
  • 5,166
  • 11
  • 35
  • 77
0
votes
0 answers

How to return XML from only a small number of endpoints?

I'm using Refit and it works fine as most of my server endpoints return JSON. However, I have a couple of endpoints that return XML. Is it possible to change Refit's ContentSerializer at runtime for specific endpoints?
Ivan Debono
  • 457
  • 3
  • 14
0
votes
0 answers

Strongly typed IDs with Refit

I am wondering how to get strongly typed IDs to work with Refit. I am using this package to automatically generate all needed things for the IDs. Here are the classes: [StronglyTypedId(typeof(Guid))] public partial struct UserId { public partial…
DirtyNative
  • 2,553
  • 2
  • 33
  • 58
0
votes
0 answers

How do I make a patch request using Refit?

I am using the refit library to call an external API. I am trying to figure out how to send a PATCH request. Can I set the fields that I am not updating to null? public class User { public string FirstName { get; set; } public string LastName{ get;…