jQuery - How to PUT JSON via Ajax?

前端 未结 3 969
感动是毒
感动是毒 2020-12-01 07:25

I am trying to put some JSON formatted data via Ajax with jQuery to a server. My code looks like this:

$.ajax({
    type: \"PUT\",
    url: myURL,
    conten         


        
3条回答
  •  粉色の甜心
    2020-12-01 07:34

    //url: this is a reference to the XML, where you need to define the mapping.
    //
    //
    
    //str1 is the input JSON that you need to pass... Ajax will automatically take care to get the response.
    //
    
    var kw = {
        url : "getEmpDetails/transEfileGenerate.app",
        timeout : 30000,
        handleAs : "json",
        sync: false,
        putData : str1,
        headers: { "Content-Type": "application/json"},
        load : function(result) {
    },
    

提交回复
热议问题