[src]
pub fn new(s: string): CookieJar {
return _CookieJar.new(s) as CookieJar;
}
Creates a new CookieJar from string
[src]
pub fn new(s: string): CookieJar {
return _CookieJar.new(s) as CookieJar;
}
Creates a new CookieJar from string
Creates a new CookieJar from string
Example
use std.net.http.CookieJar;
let cookie_jar = CookieJar.new("sessionId=abc123; theme=light");
assert_eq cookie_jar.get("sessionId")?.value(), "abc123";
assert_eq cookie_jar.get("theme")?.value(), "light";
extract_from_headers
pub fn extract_from_headers(headers: Headers): CookieJar
[src]
pub fn extract_from_headers(headers: Headers): CookieJar {
if (let header = headers.get("cookie")) {
return _CookieJar.extract_from_header(header) as CookieJar;
} else {
return _CookieJar.extract_from_header("") as CookieJar;
}
}
Extract from headers
extract_from_headers
pub fn extract_from_headers(headers: Headers): CookieJar
[src]
pub fn extract_from_headers(headers: Headers): CookieJar {
if (let header = headers.get("cookie")) {
return _CookieJar.extract_from_header(header) as CookieJar;
} else {
return _CookieJar.extract_from_header("") as CookieJar;
}
}
Extract from headers
Extract from headers
append_delta_to_headers
pub fn append_delta_to_headers(self, headers: Headers)
[src]
pub fn append_delta_to_headers(self, headers: Headers) {
(self as _CookieJar).append_delta_to_headers(headers as _Headers);
}
Append delta to headers
append_delta_to_headers
pub fn append_delta_to_headers(self, headers: Headers)
[src]
pub fn append_delta_to_headers(self, headers: Headers) {
(self as _CookieJar).append_delta_to_headers(headers as _Headers);
}
Append delta to headers
Append delta to headers
[src]
pub fn set_key(self, key: CookieKey?) {
if (let key = key) {
(self as _CookieJar).set_key(key);
}
}
Sets a PrivateJar with the key to encrypt and decrypt cookies
[src]
pub fn set_key(self, key: CookieKey?) {
if (let key = key) {
(self as _CookieJar).set_key(key);
}
}
Sets a PrivateJar with the key to encrypt and decrypt cookies
Sets a PrivateJar with the key to encrypt and decrypt cookies
[src]
pub fn add(self, cookie: Cookie) {
(self as _CookieJar).add(cookie as _Cookie);
}
Adds cookie to this jar. If a cookie with the same name already exists,
it is replaced with cookie.
[src]
pub fn add(self, cookie: Cookie) {
(self as _CookieJar).add(cookie as _Cookie);
}
Adds cookie to this jar. If a cookie with the same name already exists, it is replaced with cookie.
Adds cookie to this jar. If a cookie with the same name already exists, it is replaced with cookie.
Example
use std.net.http.{Cookie, CookieJar};
let cookie_jar = CookieJar.new("sessionId=abc123; theme=light");
let cookie = Cookie.new_with_string("foo", "bar");
cookie_jar.add(cookie);
assert_eq cookie_jar.get("foo")?.value(), "bar";
[src]
pub fn remove(self, name: string) {
(self as _CookieJar).remove(name);
}
Removes cookie from this jar.
[src]
pub fn remove(self, name: string) {
(self as _CookieJar).remove(name);
}
Removes cookie from this jar.
Removes cookie from this jar.
Example
use std.net.http.CookieJar;
let cookie_jar = CookieJar.new("sessionId=abc123; theme=light");
cookie_jar.remove("sessionId");
assert cookie_jar.get("sessionId").is_nil();
[src]
pub fn get(self, name: string): Cookie? {
if (let cookie = (self as _CookieJar).get(name)) {
return cookie as Cookie;
} else {
return nil;
}
}
Returns a reference to the Cookie
inside this jar with the name
name
. If no such cookie exists, returns nil.
[src]
pub fn get(self, name: string): Cookie? {
if (let cookie = (self as _CookieJar).get(name)) {
return cookie as Cookie;
} else {
return nil;
}
}
Returns a reference to the Cookie
inside this jar with the name
name
. If no such cookie exists, returns nil.
Returns a reference to the Cookie
inside this jar with the name
name
. If no such cookie exists, returns nil.
Example
use std.net.http.CookieJar;
let cookie_jar = CookieJar.new("sessionId=abc123; theme=light");
assert_eq cookie_jar.get("sessionId")?.value(), "abc123";
reset_delta
pub fn reset_delta(self)
[src]
pub fn reset_delta(self) {
(self as _CookieJar).reset_delta();
}
Removes all delta cookies.
reset_delta
pub fn reset_delta(self)
[src]
pub fn reset_delta(self) {
(self as _CookieJar).reset_delta();
}
Removes all delta cookies.
Removes all delta cookies.
Example
use std.net.http.CookieJar;
let cookie_jar = CookieJar.new("sessionId=abc123; theme=light");
cookie_jar.reset_delta();
private_with_key
pub fn private_with_key(self, key: CookieKey): PrivateCookieJar
[src]
pub fn private_with_key(self, key: CookieKey): PrivateCookieJar {
return (self as _CookieJar).private_with_key(key) as PrivateCookieJar;
}
Returns a PrivateJar with self as its parent jar using the key to
encrypt and decrypt cookies added/retrieved from the child jar.
private_with_key
pub fn private_with_key(self, key: CookieKey): PrivateCookieJar
[src]
pub fn private_with_key(self, key: CookieKey): PrivateCookieJar {
return (self as _CookieJar).private_with_key(key) as PrivateCookieJar;
}
Returns a PrivateJar with self as its parent jar using the key to encrypt and decrypt cookies added/retrieved from the child jar.
Returns a PrivateJar with self as its parent jar using the key to encrypt and decrypt cookies added/retrieved from the child jar.
Example
use std.net.http.{CookieKey, CookieJar};
let cookie_jar = CookieJar.new("sessionId=abc123; theme=light");
let key = CookieKey.generate();
let private = cookie_jar.private_with_key(key);
private
pub fn private(self): PrivateCookieJar
[src]
pub fn private(self): PrivateCookieJar {
return (self as _CookieJar).private() as PrivateCookieJar;
}
Similar to the private_with_key
function, but using the key specified
by the CookieJarManager::with_key
.
private
pub fn private(self): PrivateCookieJar
[src]
pub fn private(self): PrivateCookieJar {
return (self as _CookieJar).private() as PrivateCookieJar;
}
Similar to the private_with_key
function, but using the key specified
by the CookieJarManager::with_key
.
Similar to the private_with_key
function, but using the key specified
by the CookieJarManager::with_key
.
Example
use std.net.http.{CookieKey, CookieJar};
let cookie_key = CookieKey.generate();
let cookie_jar = CookieJar.new("sessionId=abc123; theme=light");
cookie_jar.set_key(cookie_key);
let private = cookie_jar.private();