Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8977

Simple REST Interface --JSONP sending wrong MIME type

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.2.1
    • Component/s: HTTP Console
    • Labels:
      None
    • Environment:
      Running on MacOS 10.7.5 - problem not verified on other platforms
    • OS X
    • Hide

      Start server with: mongod --rest --jsonp
      Make JSONP call with JQuery
      Review error message

      Show
      Start server with: mongod --rest --jsonp Make JSONP call with JQuery Review error message

      I am having a play with the Simple REST Interface via "mongod --rest --jsonp" and have run into the following error when making calls with JQquery:

      Resource interpreted as Script but transferred with MIME type text/plain

      The JQuery I am using is pretty standard:

      $.ajax({
      type: 'GET',
      url: queryUrl,
      async: true,
      contentType: "application/json",
      dataType: 'jsonp',
      jsonp: 'jsonp',
      success: function(msg) {
      if (msg.response != null && msg.response.success == true)

      { $("textarea#queryResult").val(JSON.stringify( msg.data, null, '\t' )); }

      },
      error: function(jqXHR, textStatus, errorThrown)

      { $("textarea#queryResult").val("Error: " + textStatus + " " + errorThrown); }

      });

            Assignee:
            backlog-server-platform DO NOT USE - Backlog - Platform Team
            Reporter:
            cvitter@ikanow.com Craig Vitter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: