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
de:jvx:common:util:rest [2019/03/13 10:11]
admin
de:jvx:common:util:rest [2019/03/26 22:31] (current)
admin
Line 465: Line 465:
  
 curl_close($ch);​ curl_close($ch);​
 +</​file>​
 +
 +Mittels 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