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

  • Home
  • SEARCH
  • 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 6820405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:25:15+00:00 2026-05-26T21:25:15+00:00

I am submitting a post request with data type json. I am able to

  • 0

I am submitting a post request with data type json.
I am able to see json response in fiddrel but jquery is not able to parse that.

Here is my code:

$("#jsonTestCasePost").click(function(){
        var requestType = $("#requestType").val();
        $('#result').val(requestType);
        debugger;
        $.post("http://localhost/api/number/substract", {numberA:"32",numberB:"10"},
         function(data){
            debugger;
            $('#result').val(data);
         }, requestType);
});

This is my raw response text in fiddler.

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 15
Server: Jetty(6.1.11)

{"result":"22"}

In jquery done function I see following values:

status: 0
statusTex: "", 
responses: {}
headers: ""

Any idea what am I doing wrong here?
Thanks

  • 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-26T21:25:15+00:00Added an answer on May 26, 2026 at 9:25 pm

    As requested, here’s my comment in the form of an answer:

    You are probably falling victim to restrictions due to the same origin policy. Make sure your request is being sent to the same server your page is on. Eg, if you are requesting http://localhost/api/number/substract, your current requesting page must be at http://localhost.

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

Sidebar

Related Questions

I have an ajax POST request that is supposed to be submitting data to
I have a client submitting a web-request (POST) of XML data to a server.
I am using this code if form.is_valid(): form.save() if request.POST.get('ajax') == 'true': return HttpResponse('Data
This post extends the error while submitting data in the form django model.py from
I am creating a form that requires user confirmation before submitting the data. I
I want to post some data to the server, and in response, I want
I have an action that takes POST data secured by sfGuard. This means that
I need to submit some data via ajax. It is not a form, but
I am getting 406 Not Acceptable error when submitting my form with jQuery. I
Upon submitting this form on my site. It send me to a page that

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.