JSON API: How to post a payload with special characters? #1023
-
When I post payload with special characters, I get errors such as HTTP 400 or HTTP 500. How do I post push payloads with special characters in them? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
To post special characters such as So the string Here is an example using This question came in over email and thought it might be of help to others. |
Beta Was this translation helpful? Give feedback.
To post special characters such as
!@#$%^&*()
(or others), they have to be URL encoded to their equivalent strings. This is a requirement of HTTP of which the JSON API uses as a transport.So the string
'&@#*$(@
URL encoded becomes%26%40%23%2A%24%28%40
.Here is an example using
curl
to make a JSON POST with the URL encoded string.This question came in over email and thought it might be of help to others.