2013-05-29 63 views
0

使用JavaScript,你可以使用xmlhttp.open来完成,还有其他什么方法可以做到这一点?是否可以发送自定义HTTP请求

+0

可能相关:http://stackoverflow.com/questions/4521149/http-request-from- javascript-using-raw-message-including-headers http://stackoverflow.com/questions/4463624/how-can-i-send-raw-data-in-an-http-get-request –

回答

-1

如果你不想POST方法,使用jQuery做:

$.get('test.html',{foo: 'bar'}, function(data) { 
    alert('Load was performed.'); 
}); 

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

+0

也许插入数据对象,以满足需求:'.get('test.html',{foo:'bar'},function(data){' – Imperative

+0

,但不会在URL请求中获得参数,而不是发送数据像POST这样的身体会是? – user1166981

+0

我编辑过,谢谢@Imperative – Thierry

相关问题