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()); }
public Request create() { builder.url(url); builder.tag(tag); if (headers != null) { builder.headers(headers.build()); } builder.post(requestBody); return builder.build(); }
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()); }