-
Say I am interested in doing a request similar to: As in posting some raw data in the body. Something that isn't JSON. Would the equivalent in RestEase be something like: [Post("/someApi/{name}")]
Task SetNumber([Path] string name, [Body] int number); |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you pass a string, that value is used directly as the body. If you pass a different value (which isn't one of the other special ones in that list), it will be serialized as JSON using Json.NET. Json.NET serializes the object |
Beta Was this translation helpful? Give feedback.
See here.
If you pass a string, that value is used directly as the body. If you pass a different value (which isn't one of the other special ones in that list), it will be serialized as JSON using Json.NET.
Json.NET serializes the object
3
as the string3
, so what you've posted should do what you expect. However in general if you want to control exactly what goes in the body, make it astring
.