Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 988 Bytes

Retrofit2.md

File metadata and controls

43 lines (34 loc) · 988 Bytes

Error : CLEARTEXT communication to XXXX not permitted by network security policy

  • Base Url 에 https가 아닌 http를 쓰면 CLEARTEXT communication to XXXX not permitted by network security policy 오류가 난다.
  • 해결방법 1 : BASE URL을 http -> https로 바꿈
  • 해결방법 2 : Manifest에 usesCleartextTraffic 속성을 true로 설정
<application
   ...
   android:usesCleartextTraffic="true">

🔖 REFERENCE
https://gun0912.tistory.com/80


Path

interface UserService {
    @GET("users/{name}")
    fun getUser(
        @Path("name") userName: String
    ): Call<User>
}
interface UserService {
    @GET("users")
    fun getUser(
        @Query("q") userName: String
    ): Call<User>
}



🔖 REFERENCE
https://square.github.io/retrofit/