jquery ajax rest invoke

notice:

<script type="text/javascript">
$(document).ready(function() {
   $("#b03").click(function() {
       $.ajax({
url: "http://10.0.0.11:8082/api/geo/domain",
type: "POST",
contentType: "application/json",
data: '{"input":"marvin"}'
}).then(function(data) {
alert("success");
alert(data.name);
});
});

});
</script>

注意: data后面的数据也要用引号包起来

posted @ 2016-10-19 10:07  蚂蚁都督  阅读(404)  评论(0编辑  收藏  举报