Java HTTP Header dumpHeaders(HttpURLConnection conn)

Here you can find the source of dumpHeaders(HttpURLConnection conn)

Description

dump Headers

License

Open Source License

Declaration

public static void dumpHeaders(HttpURLConnection conn) 

Method Source Code

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

import java.net.*;

public class Main {
    public static void dumpHeaders(HttpURLConnection conn) {
        String name;/* www .  j  a  v a2 s .co m*/
        String value;
        for (int i = 0; i < 20; i++) {
            name = conn.getHeaderFieldKey(i);
            value = conn.getHeaderField(i);
            if (name == null && value == null)
                break;
            System.out.println(name + "=" + value);
        }
        System.out.println();
    }
}

Related

  1. addHeadersToRequest(HttpURLConnection request, Map headers)
  2. copyHttpHeaders(@Nonnull final HttpURLConnection aConn, @Nonnull final InternetHeaders aHeaders)
  3. createHttpConnection(URL endpointUrl, String httpMethod, Map headers)
  4. delete(String url, Map headers)
  5. doDelete(URL endpoint, Map headers)
  6. dumpHeaders(HttpURLConnection conn, PrintStream out)
  7. dumpHttpHeaders(HttpURLConnection conn, java.io.PrintStream out)
  8. fillHeaders(HttpURLConnection urlConnection, Map headers)
  9. GET_Stream(String url, HashMap headers)