Java URL Connection addHeaders(Map headers, URLConnection c)

Here you can find the source of addHeaders(Map headers, URLConnection c)

Description

add Headers

License

Apache License

Declaration

private static void addHeaders(Map<String, String> headers, URLConnection c) 

Method Source Code

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

import java.net.URLConnection;

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

public class Main {
    private static void addHeaders(Map<String, String> headers, URLConnection c) {
        if (headers != null) {
            for (Entry<String, String> e : headers.entrySet()) {
                c.setRequestProperty(e.getKey(), e.getValue());
            }/*  www  .  j  a v a  2 s  . c  om*/
        }
    }
}

Related

  1. addHeaders(URLConnection conn)
  2. addProperty(URLConnection connection)
  3. byteArrayToURL(final byte[] bytes)
  4. closeURLClassLoader(URLClassLoader clazzLdr)