Created
July 27, 2019 08:35
-
-
Save Audhil/f03b634a5ce7213a2bf786290f1c9f9e to your computer and use it in GitHub Desktop.
GET request from the app - https://android.jlelse.eu/handmade-backend-for-android-app-using-python-flask-framework-b173ba2bb3aa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APIKindaStuff | |
.service | |
.greetUser("Audhil") | |
.enqueue(object : Callback<ResponseBody> { | |
override fun onFailure(call: Call<ResponseBody>, t: Throwable) { | |
println("---TTTT :: GET Throwable EXCEPTION:: " + t.message) | |
} | |
override fun onResponse(call: Call<ResponseBody>, response: Response<ResponseBody>) { | |
if (response.isSuccessful) { | |
val msg = response.body()?.string() | |
println("---TTTT :: GET msg from server :: " + msg) | |
Toast.makeText(applicationContext, msg, Toast.LENGTH_SHORT).show() | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment