ajax

package
v0.0.0-...-3519b65 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(data Request)

func Send

func Send(reqData Request)

Types

type Always

type Always func()

type Fail

type Fail func(status int, errMsg string)

type Method

type Method string
const GET Method = "GET"
const POST Method = "POST"

const

type Request

type Request struct {
	Url    string
	Method Method

	Data map[string]string // GET 和 POST url编码的数据
	Form map[string]string // POST 时候 FormData 编码的数据
	Json interface{}       // POST 时候 JSON 格式编码的数据

	Header  map[string]string
	Success Success
	Fail    Fail
	Always  Always
}

type Response

type Response struct {
	Code int
	Body string
}

type Success

type Success func(response *Response)

Jump to

Keyboard shortcuts

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