-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
31 lines (30 loc) · 1.17 KB
/
test.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
<input type="button" id="basicFetchButton" value="Try it">
<textarea rows="10" cols="50" name="response">
No REST calls yet
</textarea>
<script>
document.getElementById("basicFetchButton").addEventListener("click", function(){
theResponse = "Sending REST API Request. No Response";
// var data = new FormData();
// data.append("user_email", "[email protected]");
// data.append("password", "BI11**er");
// console.log(data);
var data = JSON.stringify({"user_email":"[email protected]","password":"BI11**er","remember_me":false});
// Loading the jQuery code
fetch("https://api.frink.global/login", {
method: 'post',
body: data,
cache: "no-cache",
contentType: "application/json"
})
.then(httpResponse => { console.log(httpResponse);});
/* .then(function (response) {
response.text().then(function (responseText) {
theResponse = responseText;
console.log(responseText);
alert("Login Response: " + responseText);
});
});
*/
});
</script>