美文网首页
springboot中使用ajax请求

springboot中使用ajax请求

作者: ljwheyxy | 来源:发表于2019-11-12 19:30 被阅读0次

成功的例子:

$.ajax({
                    type: 'POST',
                    url: baseUrl+"partTimeJob/addArticle",
                    data: JSON.stringify(data),//必须 JSON.stringify()
                    success: function (data, status) {
                        alert("数据: \n" + data + "\n状态: " + status);
                    },
                    dataType: 'json',//必须
                    contentType: 'application/json' //必须

                })

相关文章

网友评论

      本文标题:springboot中使用ajax请求

      本文链接:https://www.haomeiwen.com/subject/apnqictx.html