Android Http Get formatHttpHeaders(Map headers)

Here you can find the source of formatHttpHeaders(Map headers)

Description

Formats HTTP headers.

License

Open Source License

Parameter

Parameter Description
headers The headers.

Return

Headers as a string

Declaration

private static String formatHttpHeaders(Map<String, String> headers) 

Method Source Code

//package com.java2s;

import java.util.Map;

public class Main {
    /**//  w ww.  j  a v a  2s .co  m
     * Formats HTTP headers.
     * 
     * @param headers
     *            The headers.
     * @return Headers as a string
     */
    private static String formatHttpHeaders(Map<String, String> headers) {
        StringBuilder sb = new StringBuilder();
        for (Map.Entry<String, String> header : headers.entrySet()) {
            sb.append(String.format("%s : %s\n", header.getKey(),
                    header.getValue()));
        }
        return sb.toString();
    }
}

Related

  1. getHTTP(String... params)
  2. handleURLEncodedResponse(HttpResponse response)
  3. handleXMLResponse(HttpResponse response)
  4. getStringFromConnection( HttpURLConnection connection)
  5. httpGetRequestParseParams( String paramString)
  6. getStringResponseData(HttpResponse httpResponse)
  7. getHttpClient()
  8. maybeCreateHttpClient()
  9. sendGetRequest(String path)