"http://goo.gl/XNK93Q" ¶ó´Â ´ÜÃà URLÀ»
¾Èµå·ÎÀ̵å App¿¡¼ È£ÃâÇÒ¶§´Â Location °á°ú°ªÀÌ ¾øÀ¸³ª..
http://www.webconfs.com/http-header-check.php »çÀÌÆ®¸¦ ÅëÇØ header Á¤º¸¸¦ ºÐ¼®Çغ¸¸é Location°ªÀÌ ³ª¿À³×¿ä..
¿Ö ´Ù¸¥ °á°ú°¡ ³ª¿À´Â °ÍÀϱî¿ä..?
¾Èµå·ÎÀ̵å App¿¡¼ÀÇ ÄÚµå´Â ¾Æ·¡¿Í °°½À´Ï´Ù.
HttpClient myclient = new DefaultHttpClient();
String url = "http://goo.gl/XNK93Q";
HttpGet myget = new HttpGet(url);
HttpResponse response = null;
response = myclient.execute(myget);
HttpEntity entity = response.getEntity();
System.out.println("response:-------------------");
System.out.println(response.getStatusLine());
headers = response.getAllHeaders();
for(Header h:headers){
System.out.println(h.getName() + ": " + h.getValue());
}
ÀÌ ÄÚµå·Î ·Î±×¸¦ Âï¾îº» °á°ú°ªÀº..
08-23 10:44:22.271: I/System.out(24538): request:-------------------
08-23 10:44:22.271: I/System.out(24538): GET http://goo.gl/XNK93Q HTTP/1.1
08-23 10:44:23.703: I/System.out(24538): response:-------------------
08-23 10:44:23.703: I/System.out(24538): HTTP/1.1 200 OK
08-23 10:44:23.703: I/System.out(24538): Cache-Control: public, max-age=18
08-23 10:44:23.703: I/System.out(24538): Content-Type: text/html; charset=utf-8
08-23 10:44:23.713: I/System.out(24538): Expires: Fri, 23 Aug 2013 01:44:43 GMT
08-23 10:44:23.713: I/System.out(24538): Last-Modified: Fri, 23 Aug 2013 01:43:43 GMT
08-23 10:44:23.713: I/System.out(24538): Vary: *
08-23 10:44:23.713: I/System.out(24538): X-Frame-Options: SAMEORIGIN
08-23 10:44:23.713: I/System.out(24538): Date: Fri, 23 Aug 2013 01:44:24 GMT
08-23 10:44:23.713: I/System.out(24538): Content-Length: 47292
±×·±µ¥ À§¿¡ ÀûÀº »çÀÌÆ®¸¦ ÅëÇؼ ¾òÀº °á°ú°ª¿¡´Â Location Á¤º¸°¡ ÀÖ½À´Ï´Ù.
HTTP/1.0 301 Moved Permanently =>
Content-Type => text/html; charset=UTF-8
Cache-Control => no-cache, no-store, max-age=0, must-revalidate
Pragma => no-cache
Expires => Fri, 01 Jan 1990 00:00:00 GMT
Date => Fri, 23 Aug 2013 01:43:13 GMT
Location => http://stackoverflow.com/questions/14749307/302-redirect-from-http-to-https-in-android-using-dropbox-short-hyperlinks
X-Content-Type-Options => nosniff
X-Frame-Options => SAMEORIGIN
X-XSS-Protection => 1; mode=block
Server => GSE
Alternate-Protocol => 80:quic
¸®ÅϵǴ Status°ªÀÌ ¿Ö Á¦ app¿¡¼´Â 200À¸·Î ¿À°í Å×½ºÆ® »çÀÌÆ®¿¡¼´Â 301·Î ¿Ã±î¿ä..? | |
|
body¿¡´Â ã¾Æº¸¸é ÇØ´ç URLÀÌ ÀÖ±â´Â Çѵ¥ ´ÜÃàURLÀÇ Á¾·ù¿¡ µû¶ó Àֱ⵵ ÇÏ°í ¾ø±âµµ ÇÏ°í ±×·±°Í °°½À´Ï´Ù.
¾Èµå·ÎÀ̵忩¼ ¿¹¿Ü»çÇ×ÀÌ ¹ß»ýÇÑ°ÍÀ̶ó¸é requestÇÒ¶§ °Á¦·Î LocationÀ» ²À ¸®ÅÏÇØ´Þ¶ó°í ¿äûÇÒ ¼ö´Â ¾øÀ»±î¿ä..?