you can use the body property which lets you send data to the server
for example:
fetch("URLHERE", {
method: "POST",
body: JSON.stringify({debug: true}),
headers: { // this lets you send data in json format
'Accept': 'application/json, text/plain, */*',
'Content-Type': 'application/json'
})
.then(res => ...)
please note: you need to send the data in string format, thats why i used JSON.stringify
check here for refernce : https://javascript.info/fetch-api
EDIT: DO NOT use body in GET request
check here why: HTTP GET with request body
if you want to send data to the server you usually use POST
if you want to get data from the server with get you need to send http request with the url you want and you can also send in with query
for ex:
my endpoint is "https://api.getCoolData.com/?debugger=true
and in your server you can take the query part the use it