Laravel and External APIs: Get Data with HTTP Client

preview_player
Показать описание
This video will show a few examples of a built-in Laravel HTTP client and how easy it is to interact with external APIs to get some data, both public and with some authentication methods.

The examples I've discussed:

- - - - -
Support the channel by checking out my products:

- - - - -
Other places to follow:
Рекомендации по теме
Комментарии
Автор

I switched without a doubt when it got released, so much cleaner code.

Stoney_Eagle
Автор

It's very useful, for example, when you want to use an api that requires a secret/key/token, on the front end. You do the request on the backend, where you can hide the secret, then send the result to the client.

soniablanche
Автор

Brilliant! There’s not enough tutorials on working with an api so I’ve never really learnt. Could you show how to use a secure api that requires a regularly changing access token and how you’d go about storing that and getting a new one every hour or two please?

Can do it in postman, but clueless as to how you’d do it in laravel without having to update the token manually. Thanks and keep up the great work! 🤩

gdogmalone
Автор

Thank you for showing important points. WithToken is awesome piece which i am looking for otherwise i used withHeaders

khanaqib
Автор

thanks alot for this, i would love an example with freelancer api

innocentjosiahpatrick
Автор

u are the best mr.i always follow your chanel.thanks

johanwijanarko
Автор

Hi, thanks for your great tutorial!
I've to do 5 different http request. It’s taking a lot of time. In this scenario, I want to send the 5 requests asynchronously like Nodejs environment. But I couldn’t find out a good solution for this in Laravel. It will be nice if you wrap Async Http Request in a single video 😍

sowmik.reborn
Автор

Does it make sense to put HTTP Client requests in a Model? I can think of at least two reasons why it would: It keeps Controllers clean; If the datastore ever changes (eg from a REST API to a database), it seems like it's easier to implement a Model than to update a Controller.

Soekzxqupopo
Автор

Hello. I would be interested to know how you handle the tokens. In this example you have stored the token in the config but there are also tokens which expire after a certain time. Do you store these in a separate database table? Would you catch this in 401 and then make a new API token request and overwrite the new token in the DB? Which would be the best and safest way from your point of view?

raphaeldur
Автор

any tip for change config from admin dashboard. Env editor or store in database.

taushifkhatri
Автор

How to get some data from external api with socket and show that realtime?

overLordOrigin
Автор

Hello i have question, i am currently building an Laravel Application that imports data from a Magento API, i use the HTTP Facade but i found out that somehow laravel cached the url i am trying to fetch, and returns wrong data, is this possible?

lxwqbzm
Автор

So i need to maintain automatic log for every http api call how can i achieve it. Aprecaited

roshantwanabasu
Автор

Is there any generalized way to redirect to some other page (i.e login) upon getting HTTP Client external API response as status=0?

zaighamali
Автор

what about loging the api request? Are there any logging rules? The api may change, the data may be different, the api documentation may be bad.

L-A-O-S
Автор

Please make some videos in Laravel Json Api package

fahadrahmanamik
Автор

Hello sir, very helpful video. Could you please make a video on using guzzle with Microsoft graph API.

alberteinstein
Автор

any tip for analyzing and understanding a project that create by another person or team (laravel project)?
like what you do every time someone send you his project

abdulbasitsalah
Автор

What is the pros cons with old guzzle vs this new http client? Thank you

bboydarknesz
Автор

nice video! how do you advice between HTTP client and CURL?

ignatiusn