@Test public void requestPostConstruct_contentType() throws Exception { BaseRequest.Builder<DummyResponse> builder = new BaseRequest.Builder<>(Request.Method.POST, url, DummyResponse.class); builder.json(dummyRequestObject); builder.headers(headers); BaseRequest<DummyResponse> baseRequest = builder.build(); assertTrue("The body should be json typed", baseRequest.getBodyContentType().contains("application/json")); assertNotNull(baseRequest.getBody()); }
@Override @NonNull public String getBodyContentType() { if (HTTP_METHOD_JSON_ALLOWED.contains(getMethod()) && getJsonObject() != null) { return getJsonContentType(); } return super.getBodyContentType(); }
BaseRequest extends AbstractRequest<T> { @Override @NonNull public String getBodyContentType() { if (HTTP_METHOD_JSON_ALLOWED.contains(getMethod()) && getJsonObject() != null) { return getJsonContentType(); } return super.getBodyContentType(); } }
BaseRequest extends AbstractRequest<T> { @Override @NonNull public String getBodyContentType() { if (HTTP_METHOD_JSON_ALLOWED.contains(getMethod()) && getJsonObject() != null) { return getJsonContentType(); } return super.getBodyContentType(); } protected  BaseRequest(Builder builder); }
BaseRequest extends AbstractRequest<T> { @Override @NonNull public String getBodyContentType() { if (HTTP_METHOD_JSON_ALLOWED.contains(getMethod()) && getJsonObject() != null) { return getJsonContentType(); } return super.getBodyContentType(); } protected  BaseRequest(Builder builder); @NonNull String getJsonContentType(); @Override @NonNull String getBodyContentType(); @Nullable byte[] getJsonBody(); @Override @NonNull String getUrl(); @Nullable Object getJsonObject(); @Override @Nullable Map<String, String> getParams(); }
BaseRequest extends AbstractRequest<T> { @Override @NonNull public String getBodyContentType() { if (HTTP_METHOD_JSON_ALLOWED.contains(getMethod()) && getJsonObject() != null) { return getJsonContentType(); } return super.getBodyContentType(); } protected  BaseRequest(Builder builder); @NonNull String getJsonContentType(); @Override @NonNull String getBodyContentType(); @Nullable byte[] getJsonBody(); @Override @NonNull String getUrl(); @Nullable Object getJsonObject(); @Override @Nullable Map<String, String> getParams();  }