Esempio n. 1
0
  private static void appendHeaders(Request.Builder builder, Map<String, String> headers) {
    Headers.Builder headerBuilder = new Headers.Builder();
    if (headers == null || headers.isEmpty()) return;

    for (String key : headers.keySet()) {
      headerBuilder.add(key, headers.get(key));
    }
    builder.headers(headerBuilder.build());
  }
Esempio n. 2
0
 public Request create() {
   builder.url(url);
   builder.tag(tag);
   if (headers != null) {
     builder.headers(headers.build());
   }
   builder.post(requestBody);
   return builder.build();
 }
Esempio n. 3
0
  protected void appendHeaders() {
    Headers.Builder headerBuilder = new Headers.Builder();
    if (headers == null || headers.isEmpty()) return;

    for (String key : headers.keySet()) {
      headerBuilder.add(key, headers.get(key));
    }
    builder.headers(headerBuilder.build());
  }