我正在调用登录网络服务。但我无法检查我将从服务器获得什么。我懂了
**http://isuite.c-entron.de/CentronService/REST
Username: qus
Password: 1**
我检查浏览器http://isuite.c-entron.de/CentronService/REST&&Username=qus?Password= 1
但没有得到任何东西。
其次,我使用 ajax 像这样 404 会得到 .Is 这种调用 Web 服务的方式。
$(document).ready(function () {
//event handler for submit button
$("#btnSubmit").click(function () {
//collect userName and password entered by users
var userName = $("#username").val();
var password = $("#password").val();
//call the authenticate function
authenticate(userName, password);
});
});
//authenticate function to make ajax call
function authenticate(userName, password) {
$.ajax
({
type: "POST",
//the url where you want to sent the userName and password to
url: "http://isuite.c-entron.de/CentronService/REST",
dataType: 'json',
async: false,
//json object to sent to the authentication url
data: '{"Username": "' + userName + '", "Password" : "' + password + '"}',
success: function () {
//do any process for successful authentication here
}
})
}