Here you can find the source of getHttpResponseHeader(HttpURLConnection http)
public static Map<String, String> getHttpResponseHeader(HttpURLConnection http) throws UnsupportedEncodingException
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.util.LinkedHashMap; import java.util.Map; public class Main { public static Map<String, String> getHttpResponseHeader(HttpURLConnection http) throws UnsupportedEncodingException { Map<String, String> header = new LinkedHashMap<String, String>(); for (int i = 0;; i++) { String mine = http.getHeaderField(i); if (mine == null) break; header.put(http.getHeaderFieldKey(i), mine); }// w w w .java 2 s.c om return header; } }