当前位置: 首页>>代码示例>>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;未经允许,请勿转载。