'not getting response, how do i get response of retrofit image upload using bearer token

this is the call of interface:

usersApi.uploadImage("Bearer $token", parts).enqueue(object :Callback{ override fun onResponse(call: Call, response: Response) { if (response.isSuccessful) { Toast.makeText(this@UserProfileActivity, response.body()?.pic_url, Toast.LENGTH_SHORT).show() } }

            override fun onFailure(call: Call<UploadImageResponse>, t: Throwable) {
                Toast.makeText(this@UserProfileActivity, "not getting response", Toast.LENGTH_SHORT).show()
            }

        })

this is my interface:

@Multipart @POST("upload-profile-image") fun uploadImage( @Header("Authorization") token : String, @Part image: MultipartBody.Part ): Call



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source