How to use the OkHttp library in Android Studio

Поделиться
HTML-код
  • Опубликовано: 23 окт 2024

Комментарии • 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 4 месяца назад

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

  • @roshangame0
    @roshangame0 10 месяцев назад +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  10 месяцев назад

      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

  • @danielryan8189
    @danielryan8189 11 месяцев назад +1

    Thank you, good video :)

    • @CodesEasy
      @CodesEasy  11 месяцев назад

      Glad you liked it!

  • @insanegamerz3512
    @insanegamerz3512 Месяц назад +1

    Bro is this full learning

    • @CodesEasy
      @CodesEasy  Месяц назад

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

  • @sushanthk4638
    @sushanthk4638 3 месяца назад

    Are you malayali?