Support simple class with BodySerializationMethod.UrlEncoded
See original GitHub issueThe param is required to implement IDictionary, https://github.com/canton7/RestEase#url-encoded-bodies e.g.
Task Collect([Body(BodySerializationMethod.UrlEncoded)] Dictionary<string, object> data);
Refit can do this, see: https://github.com/paulcbetts/refit#form-posts e.g.
Task Collect([Body(BodySerializationMethod.UrlEncoded)] Measurement measurement);
// Serialized as: v=1&tid=UA-1234-5&cid=d1e9ea6b-2e8b-4699-93e0-0bcbd26c206c&t=event
Are there any reasons why RestEase doesn’t support this or is this just not implemented yet?
Nevertheless, this is an awesome lib! Keep up the good work!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How do I serialize my class to send it as urlencoded with refit
This answer might have come very late. But recently I was working on a similar use case. And the below code worked for...
Read more >Support simple class with BodySerializationMethod. ...
Support simple class with BodySerializationMethod.UrlEncoded.
Read more >Refit | The automatic type-safe REST library for Xamarin ...
For APIs that take form posts (i.e. serialized as application/x-www-form-urlencoded ), initialize the Body attribute with BodySerializationMethod.UrlEncoded .
Read more >Consuming a RESTful Web Service in Xamarin Forms ...
As you can see here, I'm using the common part of the URL (Base API URL) as a parameter in the RestService class...
Read more >RestEase
Easy -to-use typesafe REST API client library for .NET Standard 1.1 and .NET Framework 4.5 and higher, which is simple and customisable. Inspired...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Todo list:
It’s not supported because I didn’t want to start going down the rabbit hole of writing a custom serializer! Those things get complex fast: I’ve done it before.
That said, it probably isn’t too hard to let json.net turn the object into a JObject, then munge that into a query string. I’ll have an investigate.