【发布时间】:2019-03-03 06:52:21
【问题描述】:
我知道在get方法中传递参数时,它会附加到url。有没有办法在get方法中传递参数而不附加到URL。 例如
function ajaxgetCall()
{
$.ajax({
url: "http://test.com",
type: "get", //send it through get method
data: {
UserID: "test",
EmailAddress: "test@test.test"
},
success: function(response) {
console.log("Sucess");
},
error: function(xhr) {
console.log("Error");
}
});
};
ajaxgetCall();
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
所以这里的网址是,
我想要什么:
是否可以像我们在post方法中一样传递参数。
【问题讨论】:
-
有什么理由不使用
POST方法?
标签: javascript jquery ajax rest