ajax

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

View Source
const (
	MimeText   string = "text/plain; charset=utf8"
	MimeJSON   string = "application/json; charset=utf8"
	MimeStream string = "application/octet-stream"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func Delete

func Delete(url string, fn xhr.HandleFunc, x ...any) (*Client, error)

func Get

func Get(url string, fn xhr.HandleFunc, x ...any) (*Client, error)

func New

func New(fn xhr.HandleFunc, timeout ...time.Duration) *Client

func Patch

func Patch(url string, fn xhr.HandleFunc, x ...any) (*Client, error)

func Post

func Post(url string, fn xhr.HandleFunc, x ...any) (*Client, error)

func Put

func Put(url string, fn xhr.HandleFunc, x ...any) (*Client, error)

func (*Client) Delete

func (cli *Client) Delete(url string, x ...any) error

func (*Client) Do

func (cli *Client) Do(req *Request) error

func (*Client) Get

func (cli *Client) Get(url string, x ...any) error

func (*Client) JSValue

func (cli *Client) JSValue() js.Value

func (*Client) Patch

func (cli *Client) Patch(url string, x ...any) error

func (*Client) Post

func (cli *Client) Post(url string, x ...any) error

func (*Client) Put

func (cli *Client) Put(url string, x ...any) error

func (*Client) Release

func (cli *Client) Release()

func (*Client) Released

func (cli *Client) Released() bool

func (*Client) WithCredentials

func (cli *Client) WithCredentials(flag bool)

type Request

type Request struct {
	User     string
	Password string
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(method, url string, x ...any) (req *Request, err error)

NewRequest returns a request.

func (*Request) Body

func (req *Request) Body() []byte

func (*Request) Header

func (req *Request) Header(key string) string

func (*Request) Method

func (req *Request) Method() string

func (*Request) MimeType

func (req *Request) MimeType() string

func (*Request) SetHeader

func (req *Request) SetHeader(key, value string) *Request

SetHeader set request header.

func (*Request) URL

func (req *Request) URL() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL