How to call APIs from PHP: file_get_contents, cURL, Guzzle and SDKs

preview_player
Показать описание

There are several ways to make API calls from PHP. In this video we'll learn how to use each one, along with their advantages and disadvantages.

We'll cover the file_get_contents function, cURL, Guzzle and SDKs.

Details of the resources shown in the video and all the code used are below, including links to the RESTful APIs used.

Resources:
Testing API:

file_get_contents:

cURL:

Guzzle:

SDKs:

Code shown in the video:

00:00 Introduction
00:38 file_get_contents
07:06 cURL
14:22 Guzzle
19:30 SDKs
24:22 Summary

#PHP #API #REST #cURL #Guzzle #SDK
Рекомендации по теме
Комментарии
Автор

Hi, thanks for the video.
Great explanation.

Two things to point out:
- to use curl with php, for dev (in your local PC) you need to install curl and respective php extension.
- Guzzle behind the scenes will use curl if it install, if not you should had allow_url_fopen option enable.

jediampm
Автор

Thanks man. One of the best if not the best content on Youtube about APIs.

blessed-favored
Автор

Your courses are great. One request though, could you do a video on how to make our own apis in php.

shubhamtiwary
Автор

Your courses are so good and full of useful info, thanks a lot.

MrWilliamwright
Автор

Superb! I'll replicate the steps now. Well explained.

baebonana
Автор

Thanks sir i bought the php course and completed it
I learnt a lot

Shiv-vbre
Автор

Thank you ! This video just come in the right time for me !!!

jeanlegrandbokassa
Автор

Awesome. Thanks
If possible please more info about advantages and disadvantages of each one.

vivamedia
Автор

I really love your videos❤️
The way you explain and everything in details love it.👌

JahidHasan-znxj
Автор

Thanks a lot sir! Best regards from Mexico 👍

renemayett
Автор

Thank Mr Dave.
Just the video I have been searching for.
It's just as if you made this video because of me.
Thank you

mahmoudusman
Автор

Thank you so much Dave, it's a great explanation, you saved my time!

Gricenich
Автор

Kindly consider doing a video talking more about SDKs. For example how to write them.

blessed-favored
Автор

Your content are great, hope you keep posting more cause its informative specially the OOP videos. Cheers mate

collenzaligway
Автор

Can you create a Laravel course on udemy, please? Your Codeigniter course on udemy is perfect, and your voice is kinda soothing. Also, your code is well structured.

godofnothing
Автор

Awesome video. Please can the Guzzle be used for streaming.

sampahemmanuel
Автор

First of all, thanks, your videos are great....my question: How to debug my requests? In the video the are options to see http responses only(header and body)...

rafaelfigueiredofurini
Автор

which one is best for Android Application

sivaprasadsiva
Автор

Thank you for your very detailed instructions. I have a question. I want to build a search form when I enter keywords into that form and press the search button it will call to another website and then I also want to use code to perform operations like searching for something in the form of that website instead of having to go to that website to enter it manually, then also use the code to automatically click the search button (submit button) in that website (if any) and then get that search results return to my localhost website. How can I do this?

duyphi
Автор

Hello, from what I understand, your function, with the file_get_content, encode.
Personally, I would like to do the opposite, I have an api but special characters such as # or - and " are not displayed, I would even say that they are not taken into account. My question is, can I use your code to do the opposite of what you do?

mathieustamm