How to use PHP cURL to Handle JSON API Requests

Поделиться
HTML-код
  • Опубликовано: 30 май 2020
  • Learn the basics of handling API requests in PHP using cURL. The video covers:
    - interacting with an external API usingGET, POST, PUT, PATCH, DELETE requests
    - sending post data with the request
    - setting HTTP headers
    - decoding and encoding JSON data
    - writing the response to a file
    see blog: codingreflections.com
  • НаукаНаука

Комментарии • 50

  • @william254
    @william254 2 года назад +2

    I have been searching for days for a tutorial like this. Thank you so much.

  • @rodgerspenda3207
    @rodgerspenda3207 3 года назад +4

    Best Video I have seen on cURL, I can't wait for more

  • @betotrader5395
    @betotrader5395 3 года назад +5

    Very precise and useful for someone with basic curl knowledge. Thanks.

  • @thatwasepiclips
    @thatwasepiclips 2 года назад

    that was very clear and precise. thank you

  • @BeyondPhotography
    @BeyondPhotography 2 года назад +1

    very well made and very clear tutorial! thank you so much! Love the reqres.in usage and introduction.

  • @duyphi5035
    @duyphi5035 10 месяцев назад +2

    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?

  • @saskysamonte
    @saskysamonte 3 года назад

    Thank you!
    This is very helpful

  • @kike_estilo_libre
    @kike_estilo_libre 3 года назад

    Just what I need. Thanks!

  • @tech-jeweler
    @tech-jeweler 3 года назад

    thank you. Excellent demonstrated.

  • @CodingSphere
    @CodingSphere 2 года назад

    please do more videos on php. Your content is awesome.

  • @ishanb5786
    @ishanb5786 2 года назад

    Thanks Man , Helped me a lot :)

  • @javedapple1
    @javedapple1 3 года назад

    Very Useful Video.

  • @akhilatk4397
    @akhilatk4397 2 года назад

    Demonstration is very good...

  • @einarnonbinary4424
    @einarnonbinary4424 2 года назад

    You're great! Thank u a lot for the info, i'm just suscribed into your channel!!!!!!

  • @balakumarprabakaran
    @balakumarprabakaran 2 года назад

    Really Easy to learn....👍👍

  • @AkashDeep-ux1ig
    @AkashDeep-ux1ig Год назад

    Amazing vdo thank you so much

  • @jeevanandroid8674
    @jeevanandroid8674 2 года назад

    Thanks for the video

  • @mukhtarhussain8954
    @mukhtarhussain8954 Год назад

    someone please guide me a little, is it a practical exercise to use this kind of HTTP_REQUEST in production, actually to be clear i am very bad with Javascript frontend framework. I want to use PHP also as on my frontend to fetch data from an API. thanks in advance.

  • @dlago1352
    @dlago1352 3 года назад

    Great video

  • @poonambharara9068
    @poonambharara9068 5 месяцев назад

    great tutorial, thank you for making this tutorial, sir please make tutorial on firebase

  • @andreja107
    @andreja107 3 года назад

    Thank you so much

  • @honeypots345
    @honeypots345 3 года назад

    Thank you 🙂

  • @ahmedtaha-df1cw
    @ahmedtaha-df1cw 2 года назад

    please how i retrieve this data by get and loop on it and make this into table view ?

  • @muradbabayev6389
    @muradbabayev6389 2 года назад

    Thank u bro. I subscribed you channel

  • @yaswanthkumar512
    @yaswanthkumar512 2 года назад +1

    After curl then insert same data into MySQL database, need solution for this sir

  • @user-cr9tj9kn7f
    @user-cr9tj9kn7f Год назад

    thank you bro🥰

  • @dantulkas
    @dantulkas 3 года назад

    Thanks!!

  • @karamalinumberone7478
    @karamalinumberone7478 3 года назад

    hi I can't find any video to teach how I can use an API via it's manual with PHP
    can you show how use an API ?
    chose 10 API And use them

  • @LatinoWebStudio
    @LatinoWebStudio 3 года назад +2

    do you know how to then display the different objects in the array? Like the name in an tag, bio in a , image in an tag?

    • @loredana828
      @loredana828 3 года назад

      Did you find out? I need that too and can'ŧ seem to find any tutorial

    • @shahsajeeth851
      @shahsajeeth851 3 года назад

      Do u get that

  • @muhnandar2342
    @muhnandar2342 5 месяцев назад

    what if post with parameter request header and request body

  • @jayahandika242
    @jayahandika242 Год назад +1

    Thx mate

  • @animeshshrivatri9384
    @animeshshrivatri9384 2 года назад

    thanks brother

  • @sarzo_ir903
    @sarzo_ir903 3 года назад

    Hello . please give setup for decode jsone api sites exchange and show price in website with php

  • @nikhilgiri9519
    @nikhilgiri9519 Год назад

    if API is restricted then how can we pass username and password to it?

  • @kanchansadul2162
    @kanchansadul2162 Год назад

    Instead of getting data from url can we fetch data from database and can that be printed into the file ....in file handling case?

    • @CodingReflections
      @CodingReflections  Год назад

      Do you mean a remotely hosted database, or a database on the same machine?

  • @gideonriesebosch2728
    @gideonriesebosch2728 2 года назад

    I'm getting this error while trying to get the api to display the data:
    Fatal error: Uncaught Error: Call to undefined function curl_init() in C:\Users\MyUsername\PhpDestination\AppMap\App.php:48 Stack trace: #0 {main} thrown in C:\Users\MyUsername\PhpDestination\AppMap\App.php on line 48.
    I am using a real api with this.
    the rest of my code does not intervein with the curl portion.
    any guesses what's wrong?

  • @_soundwave_
    @_soundwave_ Год назад +1

    Everybody is showing how to send request. I want to know how to handle a request and send back a response.

  • @ivanreynalangan5075
    @ivanreynalangan5075 3 года назад

    Hi . Can you help , what if the url need Api key?

  • @seleldjdfmn221
    @seleldjdfmn221 4 года назад

    Here before 100K subs. what is your biggest passion? Also, let's be youtube friends? xP

  • @ismoil3075
    @ismoil3075 2 года назад

    noo AGAIN !! DAMN !

  • @gopalrao7810
    @gopalrao7810 2 года назад

    Error i am getting in CURLOPT_RETURENTRANSFER CURLOPT_RETURENTRANSFER for get the data

  • @riteshchaudhari133
    @riteshchaudhari133 7 месяцев назад

    Warning: Array to string conversion in C:\xampp\htdocs\api\curlpost.php on line 24
    TrendingCasesCP: ArraydateTime: 2023-10-17 10:37:56
    Warning: Array to string conversion in C:\xampp\htdocs\api\curlpost.php on line 24
    TotalCasesCP: Array
    showing this error what to do

  • @mezaitakfarines7262
    @mezaitakfarines7262 2 года назад

    curl_getinfo return 407 code why please help me thank you