0
$.ajax({
        type:"post",
        url: server_url,
        dataType: "jsonp",
        jsonpCallback: callback,
        data:req_json,
        cache: false,
        timeout: 60000,
        success: succeeded,
        error: got_error
    });

I am trying the above code for sending POST requset but at the server side is always receiving GET request only , can anybody tell my why is this happening? thanks in advance.. server_url is like http://ip:8007

Rahul
  • 710
  • 1
  • 8
  • 25
  • possible duplicate of [How to make a jsonp POST request that specifies contentType with jQuery?](http://stackoverflow.com/questions/3860111/how-to-make-a-jsonp-post-request-that-specifies-contenttype-with-jquery) – A. Wolff Feb 24 '14 at 13:22
  • possible duplicate - [How to use type: “POST” in jsonp ajax call](http://stackoverflow.com/questions/4508198/how-to-use-type-post-in-jsonp-ajax-call). Answer explains why it can't be done. – palanik Feb 24 '14 at 14:01

1 Answers1

7

You cannot "post" when using dataType "jsonp". Because it creates a <script> element to get the data, so it has to be a get request.

Dieterg
  • 16,118
  • 3
  • 30
  • 49