One of the servers that I'm trying to request on have \r\n in the string. These new lines are clearly visible when you try to get the request via the browser or tools such as Postman. However when I do try to get the string programatically by code, I don't see the \r\n. Why is this or is it even possible to retrieve the \r\n?
public async Task<TResponse> GetAsync(string uri)
{
var httpClient = new HttpClient();
var content = await httpClient.GetStringAsync(uri);
return JsonConvert.DeserializeObject<TResponse>(content);
}
Response should look like this in which the formatting is needed to be preserved:
Found a way to preserve the carriage returns by using HttpUtility.JavaScriptStringEncode
to the response that I receive.