I have started with the minehut API, and after looking at the docs (see a copy here) it uses get and post. As a newbie to javascript etc I dont know how it works.
Part 1 - Get Info
for example: I want to get info about a server, it says to use GET https://api.minehut.com/server/{server-id}
How would i get for example playercount from it so that i can give that info to my code and display it on my website.
Required headers:
is also mentioned in the docs, what are these and how do i use them?
Part 2 - send info
Now say for example i want to run a command, the docs say to use POST /server/{Server ID}/send_command
. It also mentions Required headers saying it needs
Content-Type
,
Authorization
and
x-session-id
how would i send a string so that it would use POST to run a command