• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java AsyncHttpHead类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.koushikdutta.async.http.AsyncHttpHead的典型用法代码示例。如果您正苦于以下问题:Java AsyncHttpHead类的具体用法?Java AsyncHttpHead怎么用?Java AsyncHttpHead使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

AsyncHttpHead类属于com.koushikdutta.async.http包,在下文中一共展示了AsyncHttpHead类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: end

点赞 2

import com.koushikdutta.async.http.AsyncHttpHead; //导入依赖的package包/类
@Override
public void end() {
    if (ended)
        return;
    ended = true;
    if (headWritten && mSink == null) {
        // header is in the process of being written... bail out.
        // end will be called again after finished.
        return;
    }
    if (!headWritten) {
        // end was called, and no head or body was yet written,
        // so strip the transfer encoding as that is superfluous.
        mRawHeaders.remove("Transfer-Encoding");
    }
    if (mSink instanceof ChunkedOutputFilter) {
        ((ChunkedOutputFilter)mSink).setMaxBuffer(Integer.MAX_VALUE);
        mSink.write(new ByteBufferList());
        onEnd();
    }
    else if (!headWritten) {
        if (!mRequest.getMethod().equalsIgnoreCase(AsyncHttpHead.METHOD))
            send("text/html", "");
        else {
            writeHead();
            onEnd();
        }
    }
    else {
        onEnd();
    }
}
 

开发者ID:jacklongway,
项目名称:LiteSDK,
代码行数:33,
代码来源:AsyncHttpServerResponseImpl.java

示例2: testHEAD

点赞 2

import com.koushikdutta.async.http.AsyncHttpHead; //导入依赖的package包/类
public void testHEAD() throws Exception {
    AsyncHttpHead req = new AsyncHttpHead(Uri.parse("http://31.media.tumblr.com/9606dcaa33b6877b7c485040393b9392/tumblr_mrtnysMonE1r4vl1yo1_500.jpg"));
    Future<String> str = AsyncHttpClient.getDefaultInstance().executeString(req, null);
    assertTrue(TextUtils.isEmpty(str.get(TIMEOUT, TimeUnit.MILLISECONDS)));
}
 

开发者ID:jacklongway,
项目名称:LiteSDK,
代码行数:6,
代码来源:HttpClientTests.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)