Here you can find the source of fillHeaders(HttpURLConnection urlConnection, Map
public static void fillHeaders(HttpURLConnection urlConnection, Map<String, String> headers)
//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*/ } }