本文整理汇总了Java中java.net.CookieHandler.put方法的典型用法代码示例。如果您正苦于以下问题:Java CookieHandler.put方法的具体用法?Java CookieHandler.put怎么用?Java CookieHandler.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.net.CookieHandler
的用法示例。
在下文中一共展示了CookieHandler.put方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveCookie
import java.net.CookieHandler; //导入方法依赖的package包/类
void saveCookie(String url, Map<String, List<String>> headers) {
if (!isUseCookie()) {
return;
}
try {
CookieHandler cookieManager = getCookieHandler();
if (headers != null) {
cookieManager.put(URI.create(url), headers);
}
} catch (Throwable ex) {
LogUtil.e(ex.getMessage(), ex);
}
}
示例2: receiveHeaders
import java.net.CookieHandler; //导入方法依赖的package包/类
public final void receiveHeaders(Headers paramHeaders)
throws IOException
{
CookieHandler localCookieHandler = this.client.cookieHandler;
if (localCookieHandler != null) {
localCookieHandler.put(this.userRequest.uri(), OkHeaders.toMultimap$29224fb9(paramHeaders));
}
}
示例3: saveCookie
import java.net.CookieHandler; //导入方法依赖的package包/类
static private void saveCookie(URI uri, String cookie) throws IOException {
CookieHandler handler = CookieHandler.getDefault();
if (handler == null) {
System.out.println("Failing due to lack of CookieHandler class!");
return;
}
System.out.println("Using CookieHandler class: " + handler.getClass().getCanonicalName());
System.out.println("Putting " + cookie + " at " + uri.toString());
handler.put(uri, responseHeaders(cookie));
}
示例4: receiveHeaders
import java.net.CookieHandler; //导入方法依赖的package包/类
public void receiveHeaders(Headers headers) throws IOException {
CookieHandler cookieHandler = this.client.getCookieHandler();
if (cookieHandler != null) {
cookieHandler.put(this.userRequest.uri(), OkHeaders.toMultimap(headers, null));
}
}
示例5: receiveHeaders
import java.net.CookieHandler; //导入方法依赖的package包/类
public void receiveHeaders(RawHeaders headers) throws IOException {
CookieHandler cookieHandler = client.getCookieHandler();
if (cookieHandler != null) {
cookieHandler.put(uri, headers.toMultimap(true));
}
}