작성
·
277
·
수정됨
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> }
위와 같이 정리해 보았는데 이게 맞는지 ㅎㅎㅎ