Message from @Vesdii
Discord ID: 508466727101661184
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
Let me give you another example. HOld on.
github url is also a good example of that tho:^)
i stopped paying attention or caring after i started crying a few minutes ago so fugghetabahtit
just returns html template instead of json
pls don't cry
For example, enter this URL in your browser.
http://wttr.in/
lol not directly about this
and now run this from a terminal:
> curl https://wttr.in
i just cry randomly because i'm no longer able to hold down the deep fears and hatred of myself after a while
It will return the current weather for your location as text.
undead
hush
it's over
https://wttr.in/tehran will return weather for Tehran, Iran.
doesn't sound fun ;~;
Oh.
I thought we were having fun.
welp
¯\_(ツ)_/¯
I was about to show a really cool example of a REST API, but I think I should just get back to my flash cards.
yeah i cried two days in a row at work last week