How to easily create cURL API requests in PHP (Wordpress, Laravel, Symfony)

preview_player
Показать описание
Let’s learn how to use cURL in PHP (and, more specifically, in WordPress, Laravel or Symfony) and why it is extremely simple.

The cURL command for PHP is the simplest way to translate a complex cURL request to PHP. Once you test it in your terminal and it works, all you need to do is translate it to PHP.

Important links from the video:

Did you get your request working on your terminal? Good.

Now go to Curl-to-PHP and paste your working cURL request. It will translate it to PHP code. It’s that easy. Just enter your bash curl request in the input above and look at the magic.

Say you need to test that an endpoint of your API is working. Just curl it in your terminal and see the results. Say, for example, that you want to retrieve the info of a Github user with a single line.

If only you could just copy and paste that curl request from the terminal to your PHP code.

Well, there is a way.
Рекомендации по теме
Комментарии
Автор

Hi! Thanks for this video, it helps me a lot!

BertrandCannamela
Автор

would you show some rest api related project?

russellazim