Message from @Undead Mockingbird

Discord ID: 508464146195677185


2018-11-04 02:06:55 UTC  

https://cdn.discordapp.com/attachments/463054787336732683/508462119050543104/Screen_Shot_2018-11-04_at_3.06.29_AM.png

2018-11-04 02:07:32 UTC  

It will send the server www.minds.com an HTTP POST to the URL https://www.minds.com/api/v1/newsfeed.

2018-11-04 02:08:04 UTC  

https://cdn.discordapp.com/attachments/463054787336732683/508462407375650826/Screen_Shot_2018-11-04_at_3.07.46_AM.png

2018-11-04 02:08:22 UTC  

And this is the payload of the request, in a format called JSON, but it could be anything.

2018-11-04 02:09:09 UTC  

oooh i know JSON, that's what Minecraft uses lol

2018-11-04 02:09:16 UTC  

Then, the server sends me back a reply indicating the status of my request, like this.

https://cdn.discordapp.com/attachments/463054787336732683/508462708631404556/Screen_Shot_2018-11-04_at_3.08.40_AM.png

2018-11-04 02:09:31 UTC  

back in the days of my very first coding adventures, i did Minecraft modding

2018-11-04 02:09:46 UTC  

https://cdn.discordapp.com/attachments/463054787336732683/508462835324420096/Screen_Shot_2018-11-04_at_3.09.34_AM.png

2018-11-04 02:10:21 UTC  

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.

2018-11-04 02:10:35 UTC  

There are few services nowadays which don't have some kind of REST API.

2018-11-04 02:10:51 UTC  

Oh, YouTube works the same way, of course.

2018-11-04 02:11:21 UTC  

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

2018-11-04 02:11:47 UTC  

You already know how to program, so you are smart enough to wrap your head around it.

2018-11-04 02:12:02 UTC  

i still don't get what REST is

2018-11-04 02:12:24 UTC  

it's a buzzword

2018-11-04 02:12:31 UTC  

REST is basically just a name for calling functions over the Internet.

2018-11-04 02:13:02 UTC  

but i think my confusion roots from the misunderstanding of how exactly an API is....implemented/applied/worked with...???? idfk

2018-11-04 02:13:15 UTC  

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.

2018-11-04 02:13:53 UTC  

API = Application Programming Interface

It's just the name for a method through which you can invoke functionality.

2018-11-04 02:14:28 UTC  

what

2018-11-04 02:14:59 UTC  

For example, let's say you have a server.

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 :^)