I am using an API to make custom QR codes in my android app. I have used this api. Now, to get the QR code, I used this code:
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{ " +
"\"data\": \"https://google.com\", " +
"\"config\": {" +
"\"body\": \"circular\"," +
"\"eyeBall\": \"ball15\"," +
"\"logo\": \"https://storage.googleapis.com/support-kms-prod/ZAl1gIwyUsvfwxoW9ns47iJFioHXODBbIkrK\" " +
"}," +
"\"size\": 500," +
"\"download\": false," +
"\"file\": \"png\" " +
"}")
val request = Request.Builder()
.url("https://qrcode-monkey.p.rapidapi.com/qr/custom")
.post(body)
.addHeader("content-type", "application/json")
.addHeader("X-RapidAPI-Host", "qrcode-monkey.p.rapidapi.com")
.addHeader("X-RapidAPI-Key", "API_KEY")
.build()
val response = client.newCall(request).execute()
Now, from here, I dont know how to get that image and load it in an image view. I think Glide can be used but I dont have any idea about that.