강의

멘토링

커뮤니티

Inflearn Community Q&A

shafeel22040's profile image
shafeel22040

asked

[LV1] Jetpack Compose - UI Practice

Retrofit - 1

Retrofit 관련 url 주소를 적을 때 주의사항입니다

Written on

·

300

·

Edited

0

 

 // HTTP 로 요청이 필요한 부분을 interface 로 정의

interface MyApi { @GET("/posts/1")

// GET 요청임을 알리고, 서버내의 경로(path)를 지정 // BASE_URL 이 https://jsonplaceholder.typicode.com 일 경우 @GET("/posts/1") 로 적고

// BASE_URL 이 https://jsonplaceholder.typicode.com/ 일 경우 @GET("posts/1") 로 적는다

suspend fun getPost1() : Response<Post> }

 

 위와 같이 정리해 보았는데 이게 맞는지 ㅎㅎㅎ

androidkotlinjetpack

Answer 1

0

bokchi님의 프로필 이미지
bokchi
Instructor

네 잘 이해하셨습니다 🙂
android retrofit get post 와 같은 키워드로 검색해보시면 관련된 예제가 많이 나올겁니다~

shafeel22040's profile image
shafeel22040

asked

Ask a question