Skip to content

Instantly share code, notes, and snippets.

@cancel-cloud
Last active June 15, 2023 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cancel-cloud/af76465189c29c89d94c7ae52e9d5d39 to your computer and use it in GitHub Desktop.
Save cancel-cloud/af76465189c29c89d94c7ae52e9d5d39 to your computer and use it in GitHub Desktop.
requests
var requestOptions = {
method: 'POST',
redirect: 'follow'
};
fetch("http://0.0.0.0:8420/student?name=lolllo&gameId=4&profilePicture=https://post.healthline.com/wp-content/uploads/2019/04/Weed_Orange_1296x728-header-1296x728.jpg", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var requestOptions = {
method: 'POST',
redirect: 'follow'
};
fetch("http://0.0.0.0:8420/game/1/join?gameId=1&studentId=1", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
----------------------------------------------------------------
var requestOptions = {
method: 'POST',
redirect: 'follow'
};
fetch("http://0.0.0.0:8420/update?gameId=1&studentId=1&points=222", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
---------------------------------------------------------------
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
var raw = "cock";
var requestOptions = {
method: 'GET',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("http://0.0.0.0:8420/game/info?gameId=1", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
GamestateModel(gameId=1, teacherId=1, students=[StudentModel(studentId=1, name=lolllo, profilePicture=https://post.healthline.com/wp-content/uploads/2019/04/Weed_Orange_1296x728-header-1296x728.jpg, gameId=4, points=4218)], gameState=NOT_STARTED, currentQuestion=QuestionModel(questionId=0, questionText=, options=[], correctAnswerIndex=0), lastQuestion=-1, results={})
https://gist.github.com/cancel-cloud/a8c8f747040a02b4ba4dcc37859b0f18
--------------------------------------------------------------------------
var requestOptions = {
method: 'POST',
redirect: 'follow'
};
fetch("http://0.0.0.0:8420/game?teacherId=1", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
-----------------------------------------------------------------------------
var requestOptions = {
method: 'GET',
redirect: 'follow'
};
fetch("http://0.0.0.0:8420/teacher?teacherId=1&teacherName=zuffinger", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
@codingwjan
Copy link

nices gist dawg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment