Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 264143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:39:39+00:00 2026-05-11T22:39:39+00:00

I am making an API for some AJAX related things in my web app

  • 0

I am making an API for some AJAX related things in my web app on GAE in Python. After setting the content-type to ‘application/json’ and accessing my url directly-

http://mysite.com/api?method=theMethod&param=firstParam

-I am being prompted with a ‘save file’ dialog box instead of seeing the JSON object displayed. The file contains the JSON object when opened in notepad.

Is this a correct way to return JSON from Python using GAE to be parsed in JavaScript?

from django.utils import simplejson
self.response.headers['Content-Type'] = 'application/json'
jsonData = {"foo" : "bar"}
self.response.out.write(simplejson.dumps(jsonData))

I have noticed that when using another API from somewhere else such as Flickr, my browser displays the JSON object rather than asking for me to save the file. This behavior is what encouraged me to investigate my implementation. My only thought is that this is related to a JSONP implementation.

Judging from rfc4627, I should be using ‘application/json’.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:39:39+00:00Added an answer on May 11, 2026 at 10:39 pm

    This is the right way, mime type for json is application/json not text/json and NEVER text/html.
    https://www.rfc-editor.org/rfc/rfc4627 starts with "The application/json Media Type for JavaScript Object Notation (JSON)"

    read this for more details/options

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making an application in Win32 API that uses the modern Ribbon style UI.
I'm making an ajax call to a rest API and specified the following header
I'm making an android application using phonegap. I'm using phonegap's Storage api for querying
I'm doing some work making a Java app compatible with alternative input devices. Unfortunately,
I am using some web API that operates by providing an API key (40
I'm making a blog API and am having some very strange issues when trying
Currently I am making some decisions for my first objective-c API. Nothing big, just
I am making a library to generate some custom content. It is pretty verbose,
Google announced the Analytics Data Export API some days ago, thereby making it much
We're making an app using PHP and using some third party services that require

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.