Question

3
Replies
1321
Views
ArtemT17 Member since 2014 7 posts
Lanit
Posted: 3 years ago
Last activity: 3 years 5 months ago
Closed
Solved

Why REST Service cannot parse json request if Content-Type header is equal to application/json;charset=UTF-8.

We have a rest service with mapping json request data to Clipboard page. When we sent request with content type = application/json, all works ok. But when content type = application/json;charset=UTF-8, request data is not parsed and Clipboard page is empty as result. In tcp dump request looks ok, for example:

POST /prweb/PRRestService/PegaMKTDataMktEvent/Services/HandleMktEvents HTTP/1.1
Host:host
User-Agent: spray-can/1.3.3
Content-Type: application/json; charset=UTF-8
Content-Length: 139
{"Timestamp":"1494512551378","CustomerID":"EMProfile1WOT_3001130640","EventType":"5cee7434-0302-4dcc-8ef1-3bf9cb094979","EventName":"Test"}

But in logs request data looks like this:

ewogICJDdXN0b21lcklEIjogIkVNUHJvZmlsZTFXT1RfMTIzNDU2NzgiLAogICJUaW1lc3RhbXAi
OiAiMTQ5MzI4MTA2OTk2OCIsCiAgIkV2ZW50TmFtZSI6ICJUZXN0QXJ0aWZhY3QiLAogICJFdmVu
dFR5cGUiOiAic29tZV9hZGRpdGlvbmFsX2luZm9fdG9fYmVfdXNlZF9ieV9jYW1wYWlnbiIsCiAg
IkxhdGl0dWRlIjogNTUuODA2ODcwLAogICJMb25naXR1ZGUiOiAzNy42MjI0MDEKfQ==

How "charset=UTF-8" affects request data?

Data Integration
Moderation Team has archived post
Share this page LinkedIn