AspNetCore.Proxy icon indicating copy to clipboard operation
AspNetCore.Proxy copied to clipboard

String escaped JSON structure - POST/PUT fails silently

Open sondreb opened this issue 4 years ago • 3 comments

Thanks for a great library! I have used it previously, and now I'm working on a different project and I have been unable to get it working with POST/PUT when the data structure includes string escaped JSON structure.

I don't have time to reproduce right now, but I'll make one another time as I just found a solution and need to do some other work. I replaced the proxy library with a very basic IHttpClientFactory usage and now it works.

It's basically a body payload that looks like this:

{
    "id": "d8223bbe-29d5-48aa-9510-9be9af965062",
    "content": "{\"category\":\"messages\",\"title\":\"This does not work\",\"content\":\"No fun...\"}"
}

The endpoint this is sent to is another .NET Core API exposed through API Management. Might be some issues there that causes this, but it works from Postman and it works from IHttpClientFactory, so I don't think the issue is there.

sondreb avatar Sep 21 '20 14:09 sondreb

Interesting. If you have a chance to PR a failing test, that would be super helpful. :)

twitchax avatar Sep 22 '20 07:09 twitchax

I will, but I have refactored the implementation to not perform string-escaped JSON and it caused similar issues. So this is likely more an problem with Azure Application Gateway / Azure API Management. I will investigate further soon.

sondreb avatar Sep 23 '20 07:09 sondreb

Hmmm, that is even weirder.

twitchax avatar Sep 23 '20 07:09 twitchax