Message from @Undead Mockingbird

Discord ID: 508466473140879373


2018-11-04 02:15:04 UTC  

you have urls, you post json to those urls, shit happens

2018-11-04 02:15:09 UTC  

tl;dr version :^)

2018-11-04 02:15:22 UTC  

Let's say, a simple Facebook. Each user has a biography and about page.

2018-11-04 02:15:40 UTC  

i dont understand servers besides the basic concept of "send request, get data", so don't even try this lol

2018-11-04 02:16:20 UTC  

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.

2018-11-04 02:16:49 UTC  

it's the same shit, but without html

2018-11-04 02:16:56 UTC  

It then sends back the content of the about page for that user and that's the return value of your remote method call.

2018-11-04 02:16:59 UTC  

oh so like

2018-11-04 02:17:00 UTC  

wait

2018-11-04 02:17:02 UTC  

hol up

2018-11-04 02:18:24 UTC  

<https://github.com/vesdii/deduper>
it executes a function that takes `vesdii` as the first param and `deduper` as the second?

2018-11-04 02:19:17 UTC  

lol that's basically exactly what you said

2018-11-04 02:19:22 UTC  

i'm just fucking thick

2018-11-04 02:19:59 UTC  

i need some cbd oil

2018-11-04 02:20:12 UTC  

yup

2018-11-04 02:21:57 UTC  

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.

2018-11-04 02:23:04 UTC  

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).

2018-11-04 02:23:31 UTC  

wut

2018-11-04 02:23:35 UTC  

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.

2018-11-04 02:23:46 UTC  

this is too meta :^)

2018-11-04 02:24:14 UTC  

REST kind of does the same. It uses URLs, which used to denote directories as function parameters.

2018-11-04 02:24:52 UTC  

For example, a REST API could return 30 for https://api.adder.com/10/20

2018-11-04 02:25:04 UTC  

Let me give you another example. HOld on.

2018-11-04 02:25:14 UTC  

THIS ISNT HELPING JUST ***STOP***

2018-11-04 02:25:30 UTC  

github url is also a good example of that tho:^)

2018-11-04 02:25:48 UTC  

i stopped paying attention or caring after i started crying a few minutes ago so fugghetabahtit

2018-11-04 02:25:49 UTC  

just returns html template instead of json

2018-11-04 02:26:02 UTC  

pls don't cry

2018-11-04 02:26:07 UTC  

For example, enter this URL in your browser.

http://wttr.in/

2018-11-04 02:26:10 UTC  

lol not directly about this

2018-11-04 02:26:44 UTC  

and now run this from a terminal:

> curl https://wttr.in

2018-11-04 02:26:54 UTC  

i just cry randomly because i'm no longer able to hold down the deep fears and hatred of myself after a while

2018-11-04 02:26:54 UTC  

It will return the current weather for your location as text.

2018-11-04 02:27:02 UTC  

undead

2018-11-04 02:27:03 UTC  

hush

2018-11-04 02:27:07 UTC  

it's over

2018-11-04 02:27:23 UTC  

https://wttr.in/tehran will return weather for Tehran, Iran.

2018-11-04 02:27:32 UTC  

doesn't sound fun ;~;

2018-11-04 02:27:48 UTC  

Oh.

2018-11-04 02:27:53 UTC  

I thought we were having fun.

2018-11-04 02:27:57 UTC  

welp