I have a very simple C# Azure Function created in VS running locally that wraps the call to a 3rd party REST API for simplicity (acts as a proxy, but not an Azure Function Proxy). All the function does after validating the supplied parameters is invoke the 3rd party REST API and directly return the results (JSON response) if the call is successful.
HttpResponseMessage response = await _httpClient.PostAsync( requestUri, content );
if ( response.IsSuccessStatusCode )
{
var jsonResponseBody = await response.Content.ReadAsStringAsync();
return req.CreateResponse( HttpStatusCode.OK, jsonResponseBody, "application/json" );
}
The resulting JSON that I get from invoking my Azure Function in Postman is similar to the following (internal double-quotes are string escaped):
"{\"Id\":\"0\",\"FirstName\":\"firstname\",\"LastName\":\"lastname\"}"
What could be causing this escaping to occur and how can I get rid of it?