XU XUv0.8.8
中文

API

#net/http/cookiejar

import: #net/http/cookiejar

counts: 2 fns, 3 methods, 2 types, 0 consts, 0 ifaces

In-memory cookie Jar. Domain-attribute cookies are ignored (no public suffix list).

struct Jar

XuAPI
pub struct Jar {
    pub names []string
    pub values []string
    pub hosts []string
    pub paths []string
    pub secures []int
}

Purpose

Public struct `Jar`.

Parameters

names []string
field ([]string)
values []string
field ([]string)
hosts []string
field ([]string)
paths []string
field ([]string)
secures []int
field ([]int)

new_jar

XuAPI
pub fn new_jar() Jar

Purpose

Construct jar.

Parameters

none

Returns

Jar — a value of this type

(&Jar) len

XuAPI
pub fn (j &Jar) len() int

Purpose

Method on `&Jar`: return the length.

Parameters

j &Jar
receiver &Jar (borrow)

Returns

int — a value of this type

(&Jar) cookies

XuAPI
pub fn (j &Jar) cookies(u &url.URL) []Cookie

Purpose

Call `cookies` on `&Jar`.

Parameters

j &Jar
receiver &Jar (borrow)
u &url.URL
u (borrowed; caller keeps it; type &url.URL)

Returns

[]Cookie — slice result