當前位置: 首頁>>代碼示例>>Java>>正文


Java Part類代碼示例

本文整理匯總了Java中org.asynchttpclient.request.body.multipart.Part的典型用法代碼示例。如果您正苦於以下問題:Java Part類的具體用法?Java Part怎麽用?Java Part使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Part類屬於org.asynchttpclient.request.body.multipart包,在下文中一共展示了Part類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addBodyPart

import org.asynchttpclient.request.body.multipart.Part; //導入依賴的package包/類
public T addBodyPart(Part bodyPart) {
    resetFormParams();
    resetNonMultipartData();
    if (this.bodyParts == null)
        this.bodyParts = new ArrayList<>();
    this.bodyParts.add(bodyPart);
    return asDerivedType();
}
 
開發者ID:amaralDaniel,項目名稱:megaphone,代碼行數:9,代碼來源:RequestBuilderBase.java

示例2: build

import org.asynchttpclient.request.body.multipart.Part; //導入依賴的package包/類
public Request build() {
    RequestBuilderBase<?> rb = executeSignatureCalculator();
    Uri finalUri = rb.computeUri();
    Charset finalCharset = rb.computeCharset();
    long finalContentLength = rb.computeRequestContentLength();

    // 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,//
            finalContentLength,//
            rb.proxyServer,//
            rb.realm,//
            rb.file,//
            rb.followRedirect,//
            rb.requestTimeout,//
            rb.rangeOffset,//
            finalCharset,//
            rb.channelPoolPartitioning,//
            rb.nameResolver);
}
 
開發者ID:amaralDaniel,項目名稱:megaphone,代碼行數:38,代碼來源:RequestBuilderBase.java

示例3: main

import org.asynchttpclient.request.body.multipart.Part; //導入依賴的package包/類
public static void main(String[] args) throws Exception{

        Part part = new StringPart("niad","hah");

        Request request = post("http://127.0.0.1:8080").addBodyPart(part).build();


        try(AsyncHttpClient asyncHttpClient = asyncHttpClient()) {

            asyncHttpClient
                    .prepareRequest(request)
                    .execute()
                    .toCompletableFuture()
                    .thenApply(Response::getResponseBody)
                    .thenAccept(System.out::println)
                    .join();

        }

    }
 
開發者ID:laidu,項目名稱:java-learn,代碼行數:21,代碼來源:Usage.java

示例4: NettyMultipartBody

import org.asynchttpclient.request.body.multipart.Part; //導入依賴的package包/類
public NettyMultipartBody(List<Part> parts, HttpHeaders headers, AsyncHttpClientConfig config) {
    this(newMultipartBody(parts, headers), config);
}
 
開發者ID:amaralDaniel,項目名稱:megaphone,代碼行數:4,代碼來源:NettyMultipartBody.java

示例5: DefaultRequest

import org.asynchttpclient.request.body.multipart.Part; //導入依賴的package包/類
public DefaultRequest(String method,//
        Uri uri,//
        InetAddress address,//
        InetAddress localAddress,//
        HttpHeaders headers,//
        List<Cookie> cookies,//
        byte[] byteData,//
        List<byte[]> compositeByteData,//
        String stringData,//
        ByteBuffer byteBufferData,//
        InputStream streamData,//
        BodyGenerator bodyGenerator,//
        List<Param> formParams,//
        List<Part> bodyParts,//
        String virtualHost,//
        long contentLength,//
        ProxyServer proxyServer,//
        Realm realm,//
        File file,//
        Boolean followRedirect,//
        int requestTimeout,//
        long rangeOffset,//
        Charset charset,//
        ChannelPoolPartitioning channelPoolPartitioning,//
        NameResolver<InetAddress> nameResolver) {
    this.method = method;
    this.uri = uri;
    this.address = address;
    this.localAddress = localAddress;
    this.headers = headers;
    this.cookies = cookies;
    this.byteData = byteData;
    this.compositeByteData = compositeByteData;
    this.stringData = stringData;
    this.byteBufferData = byteBufferData;
    this.streamData = streamData;
    this.bodyGenerator = bodyGenerator;
    this.formParams = formParams;
    this.bodyParts = bodyParts;
    this.virtualHost = virtualHost;
    this.contentLength = contentLength;
    this.proxyServer = proxyServer;
    this.realm = realm;
    this.file = file;
    this.followRedirect = followRedirect;
    this.requestTimeout = requestTimeout;
    this.rangeOffset = rangeOffset;
    this.charset = charset;
    this.channelPoolPartitioning = channelPoolPartitioning;
    this.nameResolver = nameResolver;
}
 
開發者ID:amaralDaniel,項目名稱:megaphone,代碼行數:52,代碼來源:DefaultRequest.java

示例6: getBodyParts

import org.asynchttpclient.request.body.multipart.Part; //導入依賴的package包/類
@Override
public List<Part> getBodyParts() {
    return bodyParts;
}
 
開發者ID:amaralDaniel,項目名稱:megaphone,代碼行數:5,代碼來源:DefaultRequest.java

示例7: setBodyParts

import org.asynchttpclient.request.body.multipart.Part; //導入依賴的package包/類
public T setBodyParts(List<Part> bodyParts) {
    this.bodyParts = new ArrayList<>(bodyParts);
    return asDerivedType();
}
 
開發者ID:amaralDaniel,項目名稱:megaphone,代碼行數:5,代碼來源:RequestBuilderBase.java

示例8: getBodyParts

import org.asynchttpclient.request.body.multipart.Part; //導入依賴的package包/類
/**
 * Return the current {@link Part}
 *
 * @return the current {@link Part}
 */
List<Part> getBodyParts();
 
開發者ID:amaralDaniel,項目名稱:megaphone,代碼行數:7,代碼來源:Request.java


注:本文中的org.asynchttpclient.request.body.multipart.Part類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。