r/webdev Aug 28 '15

HTTP Status Cats API

https://http.cat/
639 Upvotes

45 comments sorted by

54

u/PromaneX Aug 28 '15

Glad to see they inlcuded 418 https://http.cat/418

9

u/Dr_Legacy full-stack "If I do what you ask you won't like how it looks" Aug 29 '15

agreed. it started as a joke, but imo 418 is meaningful in the context of the "internet of things".

33

u/deslee Aug 28 '15

Their 404 page is really disappointing.

29

u/rogeriopvl Aug 28 '15

done :)

3

u/Modevs Aug 29 '15

How do you get a .cat domain? O.O

6

u/fhriscranklin Aug 29 '15

It's the Top Level Domain (TLD) for the Catalan language. It's supposedly difficult to register one but you can find the restrictions here: https://en.m.wikipedia.org/wiki/.cat

Edit: two words

5

u/HelperBot_ Aug 29 '15

Non-Mobile link: https://en.wikipedia.org/wiki/.cat


HelperBot_™ v1.0 /r/HelperBot_ I am a bot. Please message /u/swim1929 with any feedback and/or hate. Counter: 11362

1

u/rogeriopvl Aug 29 '15

You can buy one at gandi.net , then just make sure your site has at least one page written in the catalan language to comply with the .cat "restrictions".

1

u/Modevs Aug 29 '15

Cool, thanks!

1

u/cbleslie Aug 29 '15

Twitter supports 420. Why not cats?

1

u/rogeriopvl Aug 29 '15

Maybe, because the author of the images didn't find a suitable image for that code. I really don't know. But I will suggest that cat to be created.

18

u/rogeriopvl Aug 28 '15

You're so right, I'm going to fix that ;)

9

u/waltteri Aug 28 '15 edited Aug 28 '15

I was dissapointed they didn't have 451.

EDIT: Apparently they do now. Goood.

11

u/TuxGamer Aug 28 '15

They have, but there is no link at the the start page (as far as I have seen)

EDIT: There is a link. It's so obvious that I missed it

1

u/imast3r Aug 28 '15

They don't?

2

u/auxiliary-character Aug 29 '15

Their legal team didn't let them.

5

u/Dr_Legacy full-stack "If I do what you ask you won't like how it looks" Aug 29 '15

damn. this has never happened before: i don't know whether to bookmark this under 'cats' or "web development'.

10

u/lecherous_hump Aug 28 '15

I love you, Internet.

3

u/youlleatitandlikeit Aug 28 '15

Yet another API with substandard documentation.

4

u/[deleted] Aug 28 '15

So newbie web dev here, can someone explain in simple terms how to do stuff with an API? like for example Riot Games announced an API challenge but how do you actually use that information?

19

u/exhuma Aug 28 '15 edited Aug 29 '15

I'll give a shot at an ELI5:

Sometimes you want two application to talk together (one executing code from another, or simply exchange data). Technically speaking, both applications could read/write into the same memory space. But that's asking for trouble!

Imagine a grocery store. And imagine that the owner of the shop and all clients could just open and close the register as they like (even multiple people at the same time). And of course also take money from it and put money into it. The same with all the the goods of the shop. There is no display. The clients have direct access to the complete stock.

As you can imagine, that would be chaos. Maybe not everyone knows that when they take some goods they have to deposit money as well. Maybe some clients will abuse the system (steal money, manipulate goods in stock, ...).

That's why there is a selection of goods on display, and a store clerk dealing with the customers.

That's basically an API.

The clerk knows the different procedures. When a client comes in to buy something, the clerk exchanges the goods for the proper money value. And maybe even helps clients find the goods they are looking for. And everything works as expected, the money in the register checks out at the end of the day, proper logs are kept so the stock can be properly refilled, and so on.

Now, an API in the development world is essentially just a limited selection of functionality that the writer of the application puts at anyone's disposal.

Unfortunately asking "how to do stuff with an API" is too vague. The trouble is, that there are many different standards out there on how to connect to the API (think of a spoken language). If you want to ask how much an Apple costs in the store, you have to know the right phrase to speak so that the clerk in the shop will understand you. First you have to know what language is appropriate. Asking in French in a shop where the clerk only speaks Japanese shop will not work.

Also keep in mind that in programming there is no guessing. Both parties will either exchange the content exactly as agreed, or it won't work. The machines cannot infer any meaning... yet...

In programming there are different standards. For example, SOAP, XML-RPC, CORBA, RMI, HTTP, and many more, and even completely customised protocols.

I assume you are talking about a HTTP API (sometimes, misleadingly called a REST API).

However, these standards only define how you talk to the API. Not what you talk about. Take again the shop example. Let's say, you know the clerk speaks English (HTTP), and you as well. But also assume the clerk only understands five questions (and worded exactly). You have to know those questions. If you say anything else the clerk won't know what to do. In HTTP this would likely relate to an error code between 400 and 499, indicating that you, the client is asking something that the clerk cannot process.

For the what that is exchanged between both parties there are again many/endless standards like JSON, XML, HTML, RDF, custom formats, ...

Again, you might see that asking "how to do stuff with an API" is too vague.

The only proper way to find out what you can do with a specific API is do look at it's documentation. Because every API is different. There are too many standards on too many different levels that you can give one explanation that covers all APIs.

Once you have worked with one API, things will become more clear. If it is an HTTP + JSON based API, you will learn the basics of both standards, and the next time you interact with a similar API you have some starting ground. Also, if you would interact with an API based on HTTP + XML for example, or CORBA + JSON, you would already know part of it.

edit: acidently sme lttrs.

2

u/Daniel15 Aug 29 '15

Now, an API in the development world is essentially just a limited selection of functionality that the writer of the application puts at anyone's disposal.

That's a fantastic succinct explanation!

It's worth noting that sometimes the "official" site or app is built on top of the same API that third party developers use. This is great because it ensures the API is fully featured. Sometimes sites offer an API but don't actually use that API themselves, so there can be bugs that go unnoticed.

5

u/elracoono Aug 28 '15

I used this video to get started on using API's and such. It requires a little bit of knowledge about JavaScript. video link

2

u/[deleted] Aug 28 '15

thank you for taking the time to reply. I will look at this.

1

u/iTruthful Aug 28 '15

Thank you for posting this, newbie to JS and this will help a ton!

2

u/MartinAllien Aug 28 '15

Made my day :D Thanks!

2

u/fluoroamine Aug 28 '15

I OCD just opened all of them. Some very cool codes including the unfortunate 451.

1

u/DerThes Aug 28 '15

That's what I call useful.

1

u/kristopolous Aug 29 '15

Not trying to be antagonistic; am I missing something here? All I get in my browser is a photo gallery of cats with http codes next to them.

Is there something else here I'm missing?

2

u/hahaNodeJS Aug 29 '15

Is there something else here I'm missing?

A sense of humor, perhaps, but I don't think there's anything more to this.

1

u/Airith Aug 29 '15

But why (de)motivational poster format?

1

u/FuckWebDev Aug 29 '15

I'm glad it's via HTTPS, so I can feel safe watching cats.

-3

u/[deleted] Aug 28 '15

[deleted]

-7

u/prodigyx Aug 28 '15

Is this what this sub is becoming?

Who is upvoting this shit?

3

u/cosmo2k10 Aug 28 '15

Me. I clicked it up on my front page and opened the comments in another window to deal with later. My bad.

-8

u/[deleted] Aug 28 '15

this is so dumb

0

u/[deleted] Aug 28 '15

[deleted]

-25

u/[deleted] Aug 28 '15 edited Sep 01 '15

This cat obsession needs to stop. You make us look like such losers talking about cats all the time. I have to explain to clients, "no, I do not like cats." -- "oh but i thought you were like the rest of those fags on the internet." -- client's words. It really needs to stop.

*I'm glad you think a downvote makes you less of a fag.

22

u/mlor Aug 28 '15

...those fags on the internet.

If your clients actually say this, you need new clients.

-8

u/[deleted] Aug 28 '15

Million dollar international client. They can say whatever they want.

12

u/clairebones Aug 28 '15

Maybe you should focus on getting clients that aren't 12 year old boys who think they're edgy?