Java HTTP Header setHeader(HttpURLConnection urlConnection, String key, String value)

Here you can find the source of setHeader(HttpURLConnection urlConnection, String key, String value)

Description

set Header

License

Apache License

Declaration

static void setHeader(HttpURLConnection urlConnection, String key, String value) 

Method Source Code

//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
}

Related

  1. printHeaderFields(final URL url)
  2. printHttpURLConnectionHeaders(HttpURLConnection httpURLConnection)
  3. readHeadersFromResponse(HttpURLConnection httpURLConnection)
  4. setHeader(final HttpURLConnection couchdbConnection, final String headerName, final String headerValue)
  5. setHeader(HttpURLConnection con, Map headers)
  6. setHeaders(HttpURLConnection conn, List headers, String encoding)
  7. setHeadersToRequest(HttpURLConnection urlConnection, Map headersMap)
  8. submitHttpRequest(String url, Map headers, String data)