Message from @¯\_(ツ)_/¯
Discord ID: 508464190130880512
And this is the payload of the request, in a format called JSON, but it could be anything.
oooh i know JSON, that's what Minecraft uses lol
Then, the server sends me back a reply indicating the status of my request, like this.
back in the days of my very first coding adventures, i did Minecraft modding
And that's pretty much how REST APIs work in a nutshell. The same is true for Gab, Twitter, Facebook, Steemit, GNU Social, Mastodon, Discord, etc.
There are few services nowadays which don't have some kind of REST API.
Oh, YouTube works the same way, of course.
well i greatly appreciate all your effort in this explanation but its has done zero good, as i happen to just be kind of a tard
You already know how to program, so you are smart enough to wrap your head around it.
i still don't get what REST is
it's a buzzword
REST is basically just a name for calling functions over the Internet.
but i think my confusion roots from the misunderstanding of how exactly an API is....implemented/applied/worked with...???? idfk
It's using the same HTTP and URL schemas, but instead of denoting folders in a directory, for example, it encodes parameters of a call.
API = Application Programming Interface
It's just the name for a method through which you can invoke functionality.
what
For example, let's say you have a server.
you have urls, you post json to those urls, shit happens
Let's say, a simple Facebook. Each user has a biography and about page.
i dont understand servers besides the basic concept of "send request, get data", so don't even try this lol
If you point your browser at an URL like https://www.yourfacebook.com/[user]/about, then, instead of the user portion referring to a directory on the web server, it will read it as a parameter to a function that gives you the user's about page.
it's the same shit, but without html
It then sends back the content of the about page for that user and that's the return value of your remote method call.
oh so like
wait
hol up
<https://github.com/vesdii/deduper>
it executes a function that takes `vesdii` as the first param and `deduper` as the second?
lol that's basically exactly what you said
i'm just fucking thick
i need some cbd oil
yup
Well, not that particular page. That is HTML, but a lot of content is basically just JSON and some JS on your web browser will put it in the right place on the web page. It's not necessarily static content anymore, like in the Web 1.0 days.
It's kind of like abusing the postal service. Let's say you invented a secret convention with a friend, according to which you don't send them any letter (the content) necessarily, but encode what he's supposed to do in the sender address (the URL).
wut
You write something on the envelope, and it will still be delivered, but your friend will take the street address to mean a password, for example.
this is too meta :^)
REST kind of does the same. It uses URLs, which used to denote directories as function parameters.
For example, a REST API could return 30 for https://api.adder.com/10/20