Here you can find the source of formatHttpHeaders(Map
Parameter | Description |
---|---|
headers | The headers. |
private static String formatHttpHeaders(Map<String, String> headers)
//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(); } }