철스토리

Retrofit2 - 서버와 데이터를 주고받는 라이브러리 (작성중) 본문

안드로이드/유용한 라이브러리

Retrofit2 - 서버와 데이터를 주고받는 라이브러리 (작성중)

HyunChol 2016. 9. 17. 02:13
반응형
* 참고 사이트

http://gun0912.tistory.com/30

http://tosslab.github.io/android/2016/04/16/migration-to-retrofit2.html

http://hashcode.co.kr/questions/1563/retrofit2-%EB%A5%BC-%EC%9D%B4%EC%9A%A9%ED%95%9C-http-%ED%86%B5%EC%8B%A0

http://square.github.io/retrofit/

http://mytalkhome.tistory.com/867

http://falinrush.tistory.com/5

https://zeroturnaround.com/rebellabs/getting-started-with-retrofit-2/

https://inthecheesefactory.com/blog/retrofit-2.0/en

https://brunch.co.kr/@henen/25


// 파일 업로드 관련

http://stackoverflow.com/questions/34562950/post-multipart-form-data-using-retrofit-2-0-including-image

http://www.pratikbutani.com/2016/06/android-upload-image-file-using-retrofit-2-0/

https://futurestud.io/tutorials/retrofit-2-how-to-upload-multiple-files-to-server

https://futurestud.io/tutorials/retrofit-2-how-to-upload-files-to-server

http://stackoverflow.com/questions/37818301/retrofit-2-simple-upload-file-to-server

----------------------------------------------------------------------------------------------------------------------



Get방식과 Post방식 서버에 요청하는 방법

@GET("test/path")
Call<ResponseBody> getTestPath(@Query("postId") int postId);

@FormUrlEncoded
@POST("test/path")
Call<ResponseBody> getTestPath(@Field("test") String strTest);


 - Query는 Get방식에서 요청 보낼 때

 - Field는 Post방식에서 요청보낼 때 (상단에 @FromUrlEncoded 를 적어줘야 함)


반응형
Comments