Here you can find the source of setHeader(HttpURLConnection urlConnection, String key, String value)
static void setHeader(HttpURLConnection urlConnection, String key, String value)
//package com.java2s; //License from project: Apache License import java.net.HttpURLConnection; public class Main { static void setHeader(HttpURLConnection urlConnection, String key, String value) { urlConnection.setRequestProperty(key, value); }//from w w w. ja va 2 s . c o m }