WordPress.org

Ready to get started?Download WordPress

Forums

JSON API
Content-Disposition (4 posts)

  1. Marco
    Member
    Posted 3 years ago #

    Hi,
    I see you have
    header("Content-Disposition: attachment; filename=\"json_api.json\"", true);
    in the output function.
    I commented it out to be able to use plugins for Chrome to pretty-view the json in chrome without using dev=1.
    Just wondering if that header is necessary for anything in particular or if it's safe to comment it out? Don't have IE on my system so I can't test with that browser, and I recall old IE having a hard time without it. Just wonder if that's the reason for it (and if so, would like to try with 'inline' instead of 'attachment' - works well in Chrome, Safari and Firefox newest versions...)

  2. kjwierenga
    Member
    Posted 3 years ago #

    Hi Dan,

    I ran into the same issue. I'm using the JSONView Firefox add-on.

    With the Content-Disposition header, Firefox always offers to open or download the file. Without the Content-Disposition JSONView can do it's magic and pretty-print the JSON in the browser window.

    I there anything against taking out the Content-Disposition header?

    Regards,

    K-J

  3. dphiffer
    Member
    Plugin Author

    Posted 3 years ago #

    Hi guys,

    Sorry for the slow reply.

    I'm removing that header in the next release. It was a misguided attempt at providing "nicer" filenames in case you have to do anything with a downloaded JSON file.

    Thanks for the input!

  4. kjwierenga
    Member
    Posted 3 years ago #

    Hi Dan,

    Thanks for your reply. In the mean-time we've patched our install by removing the Content-Disposition header and also adding the header("HTTP/1.1 200 OK") hack to get the submit_comment stuff working.

    Many thanks for you support.

    Regards,
    K-J

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags