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

Описание к видео How to call APIs from PHP: file_get_contents, cURL, Guzzle and SDKs

PHP APIs course: ➤ https://davehollingworth.net/phpapisy
Support my channel: ☕ https://ko-fi.com/davehollingworth

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:
https://jsonplaceholder.typicode.com/

file_get_contents:
https://www.php.net/manual/en/functio...
https://www.php.net/manual/en/reserve...
https://www.php.net/manual/en/filesys...

cURL:
https://curl.se/
https://www.php.net/manual/en/book.cu...
https://www.php.net/manual/en/functio...
https://www.php.net/manual/en/functio...

Guzzle:
https://docs.guzzlephp.org/

SDKs:
https://stripe.com/docs/libraries#ser...
https://stripe.com/docs/api/customers...

Code shown in the video:
https://gist.github.com/daveh/c61fbe6...

API icon made by Smashicons (https://www.flaticon.com/authors/smas...) from Flaticon (https://www.flaticon.com)

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

Комментарии

Информация по комментариям в разработке