#HttpResponseCache
Explore tagged Tumblr posts
Text
android 고급 6강 HTTP 3 tacademy
original source : https://youtu.be/CN0X25Qi2uo
http 에서 get 통신을 하는 경우 parameter를 전달하는 방법이 2개이다.
query parameter (query string)
path parameter (restful)
==========================================================
.
.
http form을 전달하는 경우 x-www-form-urlencoded 이 사용된다. (가장 일반전인 방법)
==========================================================
.
.
아래는 여러 data를 한번에 전달하는 경우이다. 예를 들어 form 과 여러화일을 첨부해서 전달하는 경우
==========================================================
.
.
==========================================================
.
.
==========================================================
.
.
ResponseCache는 memory cache만을 제공하는 데 시스템 재시작후에도 cache가 유지되기 위해서는 file과 같은 영구 저장가능한 방법을 사용해야 한다. HttpResponseCache의 경우 손쉽게 화일을 이용하는 방법을 제공한다.
==========================================================
.
.
인증 로그인 유지 방법으로
http basic authentication
cookie
session
==========================================================
.
.
==========================================================
.
.
#android#고급#6강#HTTP#tacademy#post#get#query string#redirect#cache#ResponseCache#HttpResponseCache#cookie#authenticator#session
0 notes
Text
getCacheDir
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); try( File cascheDir = new File(this.getCasheDir(), "httpCache"); HttpResponseCache.install(cacheDir, 10 * 1024 * 1024);}catch(IOException e){ // } } @Override void onStop() { super.onStop(); HttpResponseCache httpCache = HttpResponseCache.getInstalled(); if(httpCache != null){ httpCache.flush(); } }
0 notes