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后面的数据也要用引号包起来

原文地址:https://www.cnblogs.com/mayidudu/p/5976186.html