I am using RestSharp to make a POST call to an external API.
I am adding the payload via:
request.AddParameter({field_name}, {field_value})
The API accepts { "name": "value" } (correct json format) but does NOT accept { name: "value" }
If you attempt to make a call with an incorrect json object it will throw an error similar to the following:
"{"type":"https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"traceId":"|87c7263f-4ff49301d1865eed.","errors":{"$":["'n' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0."]}}"
This might be due to the following issue
I am getting this same error message when trying to make the POST call through request.AddParameter({field_name}, {field_value})
Is there a way for me to make a request using RestSharp that allows a format similar to { "name": "value" } ?