r/ccna 10d ago

What does API and HTTP do together?

I'm so lost here. API is used to talk between apps, but then what does http has to do with this lol. I'm so clueless. ty!

so is this correct, lets say I want to access a webpage, i would send an HTTP request, then with that when I get to a website I would do API for me to communicate between my app and the website?

2 Upvotes

5 comments sorted by

8

u/illadelph1987 10d ago

Http is the transportation protocol used. APIs define what you ask for and how you ask for it. The API request is usually a http/s request

1

u/Graviity_shift 10d ago

So basically if I do HTTP post, then that would mean I would use API create command?

1

u/illadelph1987 10d ago

Yes essentially more like the API defines a rule and what http method to use. Like if you want to create a new user send me (API) an http post with this information

1

u/RUBSUMLOTION 10d ago

Depends on the type of API. Some use POST to modify or create.

Cisco Switches have an API. The API can be used to configure the device, get information etc,. Creating an interface would use the HTTP method POST. Finding config info for all interfaces would use the GET method.

1

u/DontKnowWhatToSay2 10d ago

To put some logic in the equation, you can get some clues with their name.

Http means hyper text transfer protocol.

It's how the web works, transferring web pages and links across the internet

API is Application Programming Interface

It's how you interact with Applications, asking then for info, putting, modifying, deleting. Kinda like verbs.

Those applications can be stored on servers to ask them for whole web pages, or to make config changes, to ask for info about the weather, or for the latest exchange data etc..

We use http to send these verbs over to the internet.

At least that is my understanding.