-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Unable to POST raw JSON #703
Comments
Use request.AddJsonBody instead. |
Tried that - it deserializes it even though it is already deserialized. |
@hallem Using AddJsonBody will not work, since it expects a json object. As of right now there is no way to pass in a raw json string (AddBody, and setting content to Json does not work). The workaround is getting the raw string, deserializing into a json object, and then passing that to Restsharp AddJsonBody. Definitely a wasteful workaround since Restsharp serializes back into a string that we had to begin with. EDIT: After comparing code for AddJsonBody() vs AddBody(), the following is the workaround that can be used to add raw JSON to a request body:
|
I am new to RESTSharp - and relatively new to REST in general. I have tested this service call in Postman and it works fine there with this same input but only when the json string is passed as raw text.
Service returns an Internal Server Error: "Expected parameter "Policy" not passed".
The text was updated successfully, but these errors were encountered: