webHttp request returns double escaped NewLine

Thomas Steiner 1 Reputation point
2020-11-23T07:37:49.083+00:00

I have a WCF-service which returns a string containing NewLines. The service is deployed to azure.

The returned string looks good if I use wsHttp-binding. The NewLine is correctly escaped as '\r\n' and displays with proper line breaks.

If I use the same service via webHttp-binding with WebRequest, the returned string contains double-escaped like '\r\n'.

I checked numerous variants of <globalisation> in <system.web> and also in the webHttp-behaviour and its defaultOutgoingResponseFormat.

The same scenario works fine when I deploy it to a onPrem VM.

Thomas Steiner

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,345 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,245 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,577 questions
{count} votes