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

Xamarin Forms Fusillade Refit - Using a single HttpClient instance

I've implemented the methodology outlined by Xamgirl on this post: https://xamgirl.com/consuming-restful-web-service-xamarin-forms-using-refit-part-3/ If you look at the code she's instantiating 2 ApiServices for the MakeUpApi and RedditApi and thus…
ledragon
  • 299
  • 6
  • 17
0
votes
0 answers

Convert json to pre-defined dynamic models

I am working on a project where I am using Refit library for making Http calls and parsing the data to specific models. This works well for most of it, however, I have an issue where I have parse the Json to pre-defined models at run time. As an…
0
votes
1 answer

Is it possible to configure when Refit should attempt deserialization?

Is it possible to tell Refit not to try and serialise the message body for certain HttpStatus Codes? I'm integrating with an API that (when authentication fails) returns a HTML body instead of JSON alongside a 203 status code instead of a 401/403…
Jamie Peacock
  • 372
  • 4
  • 15
0
votes
1 answer

Webapi http call results in SSL exception

I am using a library called Refit to access a RESTful service public interface IApiClient { [Get("/{Id}/shifttimes")] Task GetShiftTimes(int id); } And I'm initializing the interface in DI: builder.Register(ctx => …
Aman B
  • 2,276
  • 1
  • 18
  • 26
0
votes
2 answers

Xamarin Refit - Newtonsoft.Json.JsonSerializationException

I have some problems with JSON Serialization. When I try to deserialize my JSON Object, it returns me this error : Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type…
Yowims
  • 164
  • 2
  • 10
0
votes
3 answers

.NET Core Refit HTTPS errors

I have the below code, which uses Refit to make an HTTPS call. It works from a console application targeting the .NET framework 4.6.1. When I run the exact same code from a console application targeting .NET Core 2.1 I get an error: The SSL…
Bob
  • 4,236
  • 12
  • 45
  • 65
0
votes
1 answer

How to deserialise Array with Refit?

I have the following error trying to deserialise a Json with Refit in a PCL : Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[UserItem]' because the type requires a JSON array…
GreuM
  • 155
  • 11
0
votes
1 answer

Which one is best to consume Restful WebServices for Xamarin.Forms?

I want to go with Xamarin.Forms project. Now, I am bit confuse for consuming Rest API for this project. Performance matters. There are many available but can any body please suggest me which should be best for Xamarin.Forms(.Net Standard)? Microsoft…
Developer
  • 295
  • 4
  • 16
0
votes
1 answer

Xamarin Refit - Post request are only accessible in $_REQUEST, not in $_POST

I have a weird behavior with Xamarin Refit in a PCL. When I send a Post request from my app, the server php script can only see the result in $_REQUEST, not in $_POST. (It's a simple php script, I don't use any Framework) Here is the request…
GreuM
  • 155
  • 11
0
votes
1 answer

What setting should I change to get the int value of an enum instead of its string representation when serializing?

What setting should I change to get the property value of an enum instead of its string representation when serializing an object? I have the following class. public class ProductModel { public long ProductId { get; set; } public int…
Igor Strekha
  • 176
  • 3
  • 17
0
votes
2 answers

Severity Code Description Project File Line Suppression State Error Could not install package 'Refit 4.0.1'

Installing Refit in Xamarin MvvmCross Profile 111 .NetPortable 4.5 Severity Code Description Project File Line Suppression State Error Could not install package 'Refit 4.0.1'. You are trying to install this package into a project that…
david
  • 2,900
  • 5
  • 28
  • 48
0
votes
0 answers

TaskCanceledException on Refit call

I am implementing a simple login screen with MvvmCross Forms and Refit. The start of the authentication task is started by pressing the button that has the command 'LogInCommand'
0
votes
1 answer

Using Refit in ْXamarin the portal project

I'm tying to use Refit in Xamarin portable project I'm developing using Visual Studio for Mac OS and whenever I try to build I get this error The type or namespace 'Http' does not exist in the namespace 'System.Net'. Are you missing…
Scarnet
  • 738
  • 2
  • 11
  • 36
0
votes
0 answers

Xamarin Refit - Could not load assembly error

I am new to Xamarin platform and just give it a try this week. And when I import Refit and use it somewhere, it come out this error: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Exception…
desmond0321
  • 218
  • 2
  • 9
0
votes
2 answers

Convert url parameters using Refit

I am using the Refit library to access my API. This is working quite good, but i have some problems using a list of enums in my url. [Get("/track/")] Task> GetAll(int size = 20, int from = 0, [AliasAs("content-types")]…
Martijn00
  • 3,569
  • 3
  • 22
  • 39
1 2 3
13
14