2
我想調用這個Web服務,但它的反應是空如何調用JSON webservice?
<script type="text/javascript">
jQuery(document).ready(function(){
var user = {nick :"rajesh", password:"123456", device_id:"123456677"};
jQuery.ajax({
type: "post",
data :JSON.stringify(user),
url: "http://localhost:81/sazpin/user/users/index.json",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data) {
console.log(data);
}
});
});
</script>
我httppost客戶端是
HttpClient httpClient = new DefaultHttpClient();
// post header
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(se);
httpPost.setHeader("Accept", "application/json");
httpPost.setHeader("Content-type", "application/json");
請有人幫助我如何調用這個Web服務,並得到響應?
讀取響應數據如何是一個Web服務?我看到的只是一個JavaScript腳本。 HttpClient不會調用javascript – 2014-09-24 11:30:12
請告訴我如何調用這個 – 2014-09-24 11:43:29