Java HTTP Header fillHeaders(HttpURLConnection urlConnection, Map headers)

Here you can find the source of fillHeaders(HttpURLConnection urlConnection, Map headers)

Description

fill Headers

License

LGPL

Declaration

public static void fillHeaders(HttpURLConnection urlConnection, Map<String, String> headers) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.net.HttpURLConnection;

import java.util.Map;
import java.util.Map.Entry;

public class Main {
    public static void fillHeaders(HttpURLConnection urlConnection, Map<String, String> headers) {
        if (headers == null)
            return;

        for (Entry<String, String> entry : headers.entrySet()) {
            urlConnection.setRequestProperty(entry.getKey(), entry.getValue());
        }/*  w  w w  .j a va  2s  .co  m*/
    }
}

Related

  1. delete(String url, Map headers)
  2. doDelete(URL endpoint, Map headers)
  3. dumpHeaders(HttpURLConnection conn)
  4. dumpHeaders(HttpURLConnection conn, PrintStream out)
  5. dumpHttpHeaders(HttpURLConnection conn, java.io.PrintStream out)
  6. GET_Stream(String url, HashMap headers)
  7. getConnection(URL url, String method, Map header, String ctype)
  8. getFromUrl(Map headerMap, URL loc, Proxy proxy)
  9. getHeaderField(final URL url, final String name)