use of org.asynchttpclient.request.body.multipart.Part in project async-http-client by AsyncHttpClient.
the class RequestBuilderBase method build.
public Request build() {
RequestBuilderBase<?> rb = executeSignatureCalculator();
Uri finalUri = rb.computeUri();
Charset finalCharset = rb.computeCharset();
// make copies of mutable internal collections
List<Cookie> cookiesCopy = rb.cookies == null ? Collections.emptyList() : new ArrayList<>(rb.cookies);
List<Param> formParamsCopy = rb.formParams == null ? Collections.emptyList() : new ArrayList<>(rb.formParams);
List<Part> bodyPartsCopy = rb.bodyParts == null ? Collections.emptyList() : new ArrayList<>(rb.bodyParts);
return new //
DefaultRequest(//
rb.method, //
finalUri, //
rb.address, //
rb.localAddress, //
rb.headers, //
cookiesCopy, //
rb.byteData, //
rb.compositeByteData, //
rb.stringData, //
rb.byteBufferData, //
rb.streamData, //
rb.bodyGenerator, //
formParamsCopy, //
bodyPartsCopy, //
rb.virtualHost, //
rb.proxyServer, //
rb.realm, //
rb.file, //
rb.followRedirect, //
rb.requestTimeout, //
rb.readTimeout, //
rb.rangeOffset, //
finalCharset, //
rb.channelPoolPartitioning, rb.nameResolver);
}
Aggregations