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
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.
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.
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..?
Thanks for information, it was really useful for me :)
Glad it was helpful!
@@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?
Thank you guy !
Welcome
when i am using API if Api on the localhost then fetching many problem while building app
Thank you, good video :)
Glad you liked it!
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.
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
Bro is this full learning
There a lot more. What are you looking to learn, comment below and might make a video on it too
Are you malayali?