How to use the OkHttp library in Android Studio

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ธ.ค. 2022
  • In this video, we're going to learn how to make an HTTP request using the OkHttp library in Android Studio. We'll learn how to configure the library, create an OkHttpClient object, and make a GET and POST Request.
    If you're new to Android Studio and want to learn how to use the OkHttp library, then this video is for you! By the end of this video, you'll be able to make a GET and POST request using the OkHttp library in Android Studio.
    OkHttp Docs: square.github.io/okhttp
    Download source code: youtube.codeseasy.com/downloads
    ########## For Doubts (ask it here) ################
    Discord: / discord
    Whatsapp group: whatsappgroup.codeseasy.com
    ############################################
    ########## For Business Queries ##########
    Contact us for any business queries:
    Email: mail@codeseasy.com
    Phone number: +918281536333
    WhatsApp: whatsapp.codeseasy.com
    ####################################
    Find us on Social Media:
    Website: www.codeseasy.com
    Telegram: t.me/CodesEasyOfficial
    Facebook: / codeseasy
    Instagram: / codeseasy
    Twitter: / codeseasyblog

ความคิดเห็น • 15

  • @AndrewKosolapov-rw9tt
    @AndrewKosolapov-rw9tt ปีที่แล้ว +2

    Thanks for information, it was really useful for me :)

    • @CodesEasy
      @CodesEasy  ปีที่แล้ว

      Glad it was helpful!

    • @marco7838
      @marco7838 ปีที่แล้ว

      @@CodesEasy did you use a backend server? I am trying to make an mobile app for an intrusion detection system. I want to use a messaging protocol to send and receive data from the server to the client. Is this video something to follow to help with that?

  • @danielryan8189
    @danielryan8189 9 หลายเดือนก่อน +1

    Thank you, good video :)

    • @CodesEasy
      @CodesEasy  9 หลายเดือนก่อน

      Glad you liked it!

  • @yohany7076
    @yohany7076 11 หลายเดือนก่อน +2

    Thank you guy !

    • @CodesEasy
      @CodesEasy  11 หลายเดือนก่อน

      Welcome

  • @AkshayCompSci
    @AkshayCompSci หลายเดือนก่อน

    when i am using API if Api on the localhost then fetching many problem while building app

  • @jeffluo9591
    @jeffluo9591 ปีที่แล้ว +3

    I'm using OkHttp to send POST to my server, which is a HTTP sever not HTTPS. I do it exactly the same way as you do, but I always get the 404 page instead of the path I'm requesting. I don't know why. I check my server code and there's no problem. If I POST from a web browser with JavaScript it works fine and get to the correct path. But on my android project, it's always 404.

    • @CodesEasy
      @CodesEasy  ปีที่แล้ว

      404 means page not found that not an issue with https. Check your url path etc properly. Try opening it in the mobile device chrome.

    • @shubhammatsagar2344
      @shubhammatsagar2344 ปีที่แล้ว

      hi sir,
      actually i created application which saves my data in CSV , now i want to share that file in logstash which for visualization purpose , but problem is i can pass data from android and if i search i got to know about okhttp , please help me out what is best option to send that CSV file in jason format or anything..?

  • @sushanthk4638
    @sushanthk4638 27 วันที่ผ่านมา

    Are you malayali?

  • @roshangame0
    @roshangame0 8 หลายเดือนก่อน +1

    Hello sir, First of all Thankyou very much for the video finally i am able to call a http request.
    my code is working fine while i am connected to my local network basically i am requesting a local device that is connected to my wifi router. everything works fine until i am connected to my wifi network.
    but the problem is when i turn off the wifi then i try to request a http page after 1 seconds app crashed instead of running onFailure method, i think it's because i didn't handled the exceptions properly.
    i am calling an http request (not https) i searched over internet and not found solution can you please help me?
    In logcat i found FATAL EXCEPTION error.

    • @CodesEasy
      @CodesEasy  8 หลายเดือนก่อน

      Check the logcat while running the app then you will see details about the crash.
      Most probably you will get which line of code is causing the issue also