Un-encoded post_content in JSON
-
I’m trying to send a published post with it’s post title and post content via a JSON webhook to Discord. Here is the JSON:
{ "content": "", "embeds": [ { "title": "**{post_title}**", "description": "{post_content}", "color": null } ] }
This is the output from the notification log:
{ "content": "", "embeds": [ { "title": "**Answer**", "description": "The correct answer is C. On initial contact with Approach, aircraft are expected to make their approach request. \n \n 6.8.3 — […] If the aircraft has already been cleared to descend via the STAR from a previous Controller, it will be visible on their flight progress strip (see 6.6.11 above), Approach Controllers should respond with “Continue as Filed, Expect the [approach type/runway] at [location]” if they wish the aircraft to continue as previously cleared. If the aircraft was previously receiving vectors, was not approved for descent via the STAR or the Controller wants to issue vectors/altitude assignments, then “Expect Vectors for the [approach type/runway] at [location]” should be used instead. In the absence of Center, aircraft who have already begun their initial descent via a STAR may continue their descent with the response “Continue as Filed, Expect the [approach type/runway] at [location]” without a specific descent via clearance […]", "color": null } ] }
And this is what the notification looks like in Discord: https://ibb.co/g42QV4B
Two issues.
1. Line-breaks aren’t being added so I have to manually add
\\n
to the blog post so that the notification will add the line breaks, which isn’t ideal.2. For some reason, and I’ve searched everywhere for how to fix this, the post_content is un-encoding characters once it is being sent to Discord. See the screenshot from Discord above.
How can I resolve these two issues?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Un-encoded post_content in JSON’ is closed to new replies.