-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscript.js
More file actions
21 lines (21 loc) · 768 Bytes
/
Copy pathscript.js
File metadata and controls
21 lines (21 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
document.getElementById('form').addEventListener('submit',
function(event){
const input = document.getElementById('inbox').value;
document.getElementById('given_input').innerHTML = "input:"+input;
const url = 'https://mvnb9k0zac.execute-api.us-east-1.amazonaws.com/prod/invokemodel'
fetch(url+"?"+encodeURIComponent(input),
{
method:'POST',
headers: {'Content-Type':'application/json'}
}
)
.then(response => response.json())
.then(data =>
{
// console.log(data);
document.getElementById('output').innerHTML = "output:"+data;
}
)
event.preventDefault();
}
)