code: private static void header(Map<String, String> header, HttpURLConnection httpUrlConn) {
          if (header == null)
              return;
          if (!header.isEmpty()) {
              for (Map.Entry<String, String> map : header.entrySet()) {
                  String headerKey = map.getKey();
                  String headerValue = map.getValue();
                  httpUrlConn.setRequestProperty(headerKey, headerValue);
              }
          }
      }
docs: header代码段