Message Boards Message Boards

0
|
3409 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

JSON payload with diacritics for HTTPRequest

Posted 3 years ago

Working in the creations of APIs with Mathematica 12.2, I got this problem with diacritics when sending JSON data.

Here is a toy code using httpbin.

HTTPRequest["https://httpbin.org/anything",
      <|
      Method->"POST"
      ,"Body" -> (<|"textWithDiacritics"-> "àéíóú"|>//ExportString[#, "RawJSON"]&)
        |>
     ]//URLRead[#, "BodyBytes"]&//FromCharacterCode//ImportString[#, "RawJSON"]&

enter image description here

I found this related post, It seams to be a bug in ExportString for RawJSON.

Any suggestions on how to get around this case?

Cross post in Stack Exchange.

POSTED BY: Rodrigo Murta
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract