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 8434399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:38:40+00:00 2026-06-10T06:38:40+00:00

I have a rest server running (python bottle) on the same host that is

  • 0

I have a rest server running (python bottle) on the same host that is running my django application.
From my django application I am doing a get request using ajax, but the request is failing even though I can see the status of the request succeeding on my rest server(returns code 200, success)

My Ajax code:

            $.ajax({
               url: 'http://hostname:port/ListVms/',
               crossDomain: true, 
               contentType: "application/json",
               dataType: 'jsonp',
               success: function(data) {
                   alert('worked');
               },
               error: function() {
                   alert("Sorry, error retrieving!");
               }
           });

Python Rest method:

            @route('/ListVms/', method='GET')
            def get_event():
                return json.dumps(JS)

Output from the rest service:

            [22/Aug/2012 10:25:45] "GET /ListVms/?callback=jQuery17102901058990901989_1345656355311&_=1345656355356 HTTP/1.1" 200 44
  • 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-06-10T06:38:42+00:00Added an answer on June 10, 2026 at 6:38 am

    I’m guessing your server is returning JSON, like this:

    { "abc": 123 }
    

    This format is incompatible with JSONP. JSONP requires a callback function that the JSON is passed to. The callback function is passed to your server in that query string.

    So using JSONP the browser plunks down a script tag like this:

    <script src="http://hostname:port/ListVms/?callback=jQuery17102901058990901989_1345656355311"></srcipt>
    

    And your server should respond with this:

    jQuery17102901058990901989_1345656355311({
      "abc": 123
    });
    

    Typically servers that serve JSON and want to support JSONP have a conditional that looks kind of like this:

    if queryString.callback
      render queryString.callback + "(" + jsonData + ")"
    else
      render jsonData
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a REST server and a client application running on a mobile device.
I have an application that uses rest to communicate to a server, i would
I have developed a REST application server based on RESTEasy (JAX-RS). I have a
I have to map a REST Webservice URL like http://server:8080/application/service/customer/v1 to createCustomer method in
i have a data access layer that abstracts the rest of the application away
I have two GeoServers running in the same machine Ubuntu Server 9.04. GeoServer V2.0.1
basically what I have is an application server running liferay portal. and we also
I have a REST Server running on Tomcat 5.5. Some of the services need
I have a WCF REST service that I customized from the VS2010 online template.
I have created a REST server under ASP.NET and I can't figure out the

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.