How to use the OkHttp library in Android Studio

Поділитися
Вставка
  • Опубліковано 6 вер 2024
  • 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....
    Download source code: youtube.codese...
    ########## For Doubts (ask it here) ################
    Discord: / discord
    Whatsapp group: whatsappgroup....
    ############################################
    ########## For Business Queries ##########
    Contact us for any business queries:
    Email: mail@codeseasy.com
    Phone number: +918281536333
    WhatsApp: whatsapp.codes...
    ####################################
    Find us on Social Media:
    Website: www.codeseasy.com
    Telegram: t.me/CodesEasy...
    Facebook: / codeseasy
    Instagram: / codeseasy
    Twitter: / codeseasyblog

КОМЕНТАРІ • 18

  • @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..?

  • @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?

  • @yohany7076
    @yohany7076 Рік тому +2

    Thank you guy !

  • @AkshayCompSci
    @AkshayCompSci 2 місяці тому

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

  • @danielryan8189
    @danielryan8189 10 місяців тому +1

    Thank you, good video :)

    • @CodesEasy
      @CodesEasy  10 місяців тому

      Glad you liked it!

  • @roshangame0
    @roshangame0 9 місяців тому +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  9 місяців тому

      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

  • @insanegamerz3512
    @insanegamerz3512 11 днів тому +1

    Bro is this full learning

    • @CodesEasy
      @CodesEasy  9 днів тому

      There a lot more. What are you looking to learn, comment below and might make a video on it too

  • @sushanthk4638
    @sushanthk4638 2 місяці тому

    Are you malayali?