ui: Add Accept header to retrieve JSON errors

This commit is contained in:
nemunaire 2021-09-06 13:46:24 +02:00
commit bd8db24997
7 changed files with 11 additions and 5 deletions

View file

@ -43,6 +43,7 @@
"submit/" + exercice.id,
{
method: "POST",
headers: {'Accept': 'application/json'},
body: JSON.stringify(responses),
}
)

View file

@ -47,6 +47,7 @@
"openhint/" + exercice.id,
{
method: "POST",
headers: {'Accept': 'application/json'},
body: JSON.stringify({ id: hint.id }),
}
)

View file

@ -41,6 +41,7 @@
"wantchoices/" + exercice_id,
{
method: "POST",
headers: {'Accept': 'application/json'},
body: JSON.stringify({ id: Number(flag.id) }),
}
)

View file

@ -48,6 +48,7 @@
const response = await fetch('chname', {
method: "POST",
headers: {'Accept': 'application/json'},
body: JSON.stringify({newName: newTeamName}),
});