Java HTTP Header dumpHttpHeaders(HttpURLConnection conn, java.io.PrintStream out)

Here you can find the source of dumpHttpHeaders(HttpURLConnection conn, java.io.PrintStream out)

Description

dump Http Headers

License

Open Source License

Declaration

public static void dumpHttpHeaders(HttpURLConnection conn, java.io.PrintStream out) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Map;
import java.util.List;
import java.net.HttpURLConnection;

public class Main {
    public static void dumpHttpHeaders(HttpURLConnection conn, java.io.PrintStream out) {
        Map<String, List<String>> map = conn.getHeaderFields();

        out.println("Printing All Response Header for URL: " + conn.getURL().toString() + "\n");

        for (Map.Entry<String, List<String>> entry : map.entrySet()) {
            out.println(entry.getKey() + " : " + entry.getValue());
        }//w  ww  . j  av  a2s. c o m
    }
}

Related

  1. createHttpConnection(URL endpointUrl, String httpMethod, Map headers)
  2. delete(String url, Map headers)
  3. doDelete(URL endpoint, Map headers)
  4. dumpHeaders(HttpURLConnection conn)
  5. dumpHeaders(HttpURLConnection conn, PrintStream out)
  6. fillHeaders(HttpURLConnection urlConnection, Map headers)
  7. GET_Stream(String url, HashMap headers)
  8. getConnection(URL url, String method, Map header, String ctype)
  9. getFromUrl(Map headerMap, URL loc, Proxy proxy)