-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjsRequestCode.txt
More file actions
57 lines (53 loc) · 1.74 KB
/
jsRequestCode.txt
File metadata and controls
57 lines (53 loc) · 1.74 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
getData() {
// create a new XMLHttpRequest
var xhr = new XMLHttpRequest();
// get a callback when the server responds
xhr.addEventListener('load', () => {
// update the state of the component with the result here
console.log(xhr.responseText)
})
// xhr.open('POST', 'http://localhost:8080/createEvent');
// let req = {
// creator: "Jimmy",
// description: "description is good",
// name: "This is a cool event",
// times: [
// {
// year: "2022",
// month: "2",
// day: "26",
// hour: "6"
// },
// {
// year: "2022",
// month: "2",
// day: "26",
// hour: "7"
// }
// ]
// }
// xhr.open('POST', 'http://localhost:8080/voteEvent');
// let req = {
// eventID: "982e375d-1ab9-4bbf-b6d9-9d1d3864eba4",
// name: "This is a cool event",
// times: [
// {
// year: "2022",
// month: "2",
// day: "26",
// hour: "6"
// },
// {
// year: "2022",
// month: "2",
// day: "26",
// hour: "7"
// }
// ]
// }
// xhr.open('POST', 'http://localhost:8080/getEvent');
// let req = {
// eventID: "982e375d-1ab9-4bbf-b6d9-9d1d3864eba4"
// }
//xhr.send(JSON.stringify(req));
}