Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val formBody = FormBody.Builder()
- .add("group", group.text.toString())
- .add("description", description.text.toString())
- .add("category", arguments?.getString("id", "null"))
- .build()
- val request = Request.Builder()
- .url("http://192.168.100.70:3000/amigosApi/grp/group/")
- .post(formBody)
- .build()
- val client = OkHttpClient()
- val response = client.newCall(request).execute()
- response.body()?.let {
- val responseString = it.string()
- Log.d("xtx", responseString)
- Log.d("xtx", group.text.toString())
- Log.d("xtx", description.text.toString())
- uiThread {
- if (responseString.contains("200")) {
- ctx?.toast("Sucessful")
- dismiss()
- } else {
- ctx?.toast("Entry failed")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment