-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support simple class with BodySerializationMethod.UrlEncoded #79
Comments
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. |
I guess whatever happens to request bodies should also happen to query maps. |
This is the class in Refit which is responsible to convert an object to a Dictionary: It is used here: The field names are retrieved via Reflection and then inserted into the FormUrlEncodedContent class. |
Todo list:
|
A simple workaround could be: public class MeasurementWrapper : Dictionary<string, object>
{
public MeasurementWrapper(Measurement m)
{
Add("v", m.V);
Add("id", m.Id);
}
} |
I had a look at this. Some notes on some of the complexity that needs to be worked through:
So, that issues are:
|
The param is required to implement IDictionary, https://github.com/canton7/RestEase#url-encoded-bodies e.g.
Refit can do this, see: https://github.com/paulcbetts/refit#form-posts e.g.
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!
The text was updated successfully, but these errors were encountered: