canton7 / canton7/RestEase

Support simple class with BodySerializationMethod.UrlEncoded

Open
#79 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.1k
Forks
114
PR merge metrics
No merged PRs in 30d

Description

The param is required to implement IDictionary, https://github.com/canton7/RestEase#url-encoded-bodies e.g.
```c#
Task Collect([Body(BodySerializationMethod.UrlEncoded)] Dictionary data);
```

Refit can do this, see: https://github.com/paulcbetts/refit#form-posts e.g.
```c#
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!

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names BodySerializationMethod.UrlEncoded and shows Dictionary and Measurement examples, but no repository files or tests. Start by tracing the existing UrlEncoded body handling and its IDictionary requirement. Done means a simple class such as Measurement can be serialized into the requested form fields while the existing dictionary example continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.