本文整理匯總了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));
}
}