generated from ldynia/django
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrpc_client.html
38 lines (35 loc) · 1.06 KB
/
rpc_client.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<html lang="en">
<head>
<script src="https://unpkg.com/[email protected]/dist/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-xmlrpc/0.4.3/jquery.xmlrpc.min.js"></script>
<script script type="text/javascript">
$(document).ready(function(){
var msg = 'hello'
document.getElementById('sent').textContent = msg
$.xmlrpc({
url: 'http://localhost:8080/api/rpc/xml',
methodName: 'upper',
params: [msg],
success: function(response, status, jqXHR) {
document.getElementById('received').textContent = response[0]
},
error: function(jqXHR, status, error) {
console.log('error')
}
})
})
</script>
</head>
<body>
<table>
<tr>
<th>Sent</th>
<th>Received</th>
</tr>
<tr>
<td id="sent">TODO</td>
<td id="received">TODO</td>
</tr>
</table>
</body>
</html>