Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
jvx:common:util:rest [2019/03/13 09:11]
admin
jvx:common:util:rest [2019/03/26 21:30]
admin [Integration]
Line 464: Line 464:
  
 curl_close($ch);​ curl_close($ch);​
 +</​file>​
 +
 +Using Javascript:
 +
 +<file html rest.html>​
 +<​html>​
 +<​head>​
 +<​script>​
 +function doRest() {
 +    const http = new XMLHttpRequest();​
 +    const url='​https://<​server>/​DB/​services/​rest/​League/​Standings/​action/​getResults';​
 +
 +    http.open("​POST",​ url, true, '​user',​ '​password'​);​
 +    http.withCredentials = true;
 +    http.send("​[88]"​);​
 +
 +    http.onreadystatechange=(e)=>​
 +    {
 + if (http.readyState == 4)
 + {
 +     console.log(atob(eval(http.responseText)));​
 + }
 +    }
 +}
 +</​script>​
 +</​head>​
 +<​body>​
 +<button type="​button"​ onclick="​doRest()">​REST call</​button>​
 +</​body>​
 +</​html>​
 </​file>​ </​file>​
  
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information