protected Request buildMultipartRequest(String path,MultipartEntity multiPart) { HttpPost httpPost = new HttpPost(builder.buildUrl(path)); httpPost.setEntity(multiPart); /** * In case of Multipart requests, we must __NOT__ set the content-type header to multipart/form-data. * If we do it, we have a 400 response (bad request). */ return this.builder.buildOtherRequest(httpPost); }
/** * Build a GET request to specified path with optional query * parameters. See {@link #buildUrl(String, String...)} for * queryParameters semantics. */ public Request buildGetRequest(String path, String... queryParameters) { return new Request(new HttpGet(buildUrl(path, queryParameters))); }
/** * Build a POST request to specified path with optional query * parameters. See {@link #buildUrl(String, String...)} for * queryParameters semantics. */ public Request buildPostRequest(String path) { return new Request(new HttpPost(buildUrl(path))); }