[英]jQuery: how to make http request with arguments and body?
所以我想用正文(例如file, file2, file3
)和诸如action=delete
类的参数发出一个http请求,如何用jquery发出这样的请求?
Pass parameters with url
and files
with body: 使用url
传递参数,使用body传递files
:
$.ajax({
url: 'someurl' + '?action=delete',
type: 'POST',
data: requestbodyhere,
success: function(responseData){
}
});
You want to do a POST? 您要执行POST吗? You can do that using Ajax: 您可以使用Ajax做到这一点:
jQuery.ajax({
type: 'POST',
url: url,
data: {
file1:'file1',
flie2:'file2'
},
success: function(response) {
//in response you have the answer from the server as a string
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.