Jump to content

Outputting JSON response from within an addon


Tcalp

Recommended Posts

  • 5 years later...

The answer above should be enough for most cases, but you might want to set up the HTTP headers to mark the content as a JSON as well.

Just adding

header('Content-Type: application/json; charset=utf-8');

to your code before  echoing the JSON object (as described in sentq's comment) should do the trick.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated