Documentation
¶
Index ¶
- Constants
- type Body
- type Fetch
- type Header
- type Headers
- func (h *Headers) All() iter.Seq2[types.ByteString, types.ByteString]
- func (h *Headers) Append(name, val types.ByteString)
- func (h *Headers) Delete(name types.ByteString)
- func (h *Headers) Get(name types.ByteString) (string, bool)
- func (h *Headers) Has(name types.ByteString) bool
- func (h *Headers) Set(name, value types.ByteString)
- type ReadableStream
- type Reader
- type Request
- type RequestOption
- type Response
Constants ¶
View Source
const MAX_HEADER_COUNT = 10000
When iterating headers, have a max header count, to prevent overflow if client code continuously add new headers while iterating.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Body ¶
type Body interface {
io.Reader
Body() streams.ReadableStream
}
Body represents the Body IDL mixin defined in the fetch API.
type Fetch ¶
type Fetch struct {
BrowsingContext html.BrowsingContext
}
func New ¶
func New(bc html.BrowsingContext) Fetch
func (Fetch) NewRequest ¶
func (f Fetch) NewRequest(url string, opts ...RequestOption) Request
type Headers ¶ added in v0.9.2
func (*Headers) All ¶ added in v0.10.3
func (h *Headers) All() iter.Seq2[types.ByteString, types.ByteString]
All() returns an iterator of key/value pairs of header keys and values. The same key may appear multiple times in the output. The returned order is guaranteed to be sorted by name. The iterator operates on a live list, i.e. new headers can be inserted while iterating. Panics if the number of headers iterated exceed MAX_HEADER_COUNT.
func (*Headers) Append ¶ added in v0.9.2
func (h *Headers) Append(name, val types.ByteString)
func (*Headers) Delete ¶ added in v0.9.2
func (h *Headers) Delete(name types.ByteString)
func (*Headers) Set ¶ added in v0.9.2
func (h *Headers) Set(name, value types.ByteString)
type ReadableStream ¶
func (ReadableStream) GetReader ¶
func (s ReadableStream) GetReader(opts ...streams.GetReaderOption) streams.Reader
type RequestOption ¶
type RequestOption func(*Request)
func WithBody ¶ added in v0.9.2
func WithBody(b io.Reader) RequestOption
func WithHeaders ¶ added in v0.10.3
func WithHeaders(h [][2]types.ByteString) RequestOption
func WithMethod ¶ added in v0.9.2
func WithMethod(m string) RequestOption
func WithSignal ¶
func WithSignal(s *dom.AbortSignal) RequestOption
Click to show internal directories.
Click to hide internal directories.