Passing Data in JSONP

Is it possible to pass POST data to JSONP? Or should all data be passed to querystring as a GET request? any sample code.

thank

+3
source share
3 answers

If you are using jQuery try $ .post ()

http://api.jquery.com/jQuery.post/

Edit: A more detailed solution is here: How to use getJSON while sending data using the post method?

0
source

No, you cannot send data in JSONP. JSONP must be "sent" as a script tag, and script tags cannot receive POST information.

Hope this helps.

+6
source

:

   $.ajax({
        url: ajaxUrl,
        dataType: 'jsonp',
        type: 'GET',
        cache: false,
        success: sCallbackFunction,
        error: eCallbackFunction,
        jsonpCallback: jsonpCallbackFunction,
        data: dataObject
    });
0

Source: https://habr.com/ru/post/1775763/


All Articles