request

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(url string, header et.Json) (*Body, Status)

Request delete method

func Get

func Get(url string, header et.Json) (*Body, Status)

Request get method

func Options

func Options(url string, header et.Json) (*Body, Status)

Request options method

func Patch

func Patch(url string, header, body et.Json) (*Body, Status)

Request patch method

func Post

func Post(url string, header, body et.Json) (*Body, Status)

Request post method

func Put

func Put(url string, header, body et.Json) (*Body, Status)

Request put method

Types

type Body added in v1.0.22

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

* * Body struct to convert the body response *

func ReadBody added in v1.0.22

func ReadBody(body io.ReadCloser) (*Body, error)

* * ReadBody reads the body response * @param body io.ReadCloser * @return *Body * @return error *

func (Body) ToArrayJson added in v1.0.22

func (b Body) ToArrayJson() ([]et.Json, error)

* * ToArrayJson returns a Json array object * @return []et.Json *

func (Body) ToBool added in v1.0.22

func (b Body) ToBool() (bool, error)

* * ToBool returns a boolean * @return bool *

func (Body) ToFloat added in v1.0.22

func (b Body) ToFloat() (float64, error)

* * ToFloat returns a float * @return float64 *

func (Body) ToInt added in v1.0.22

func (b Body) ToInt() (int, error)

* * ToInt returns an integer * @return int *

func (Body) ToInt64 added in v1.0.22

func (b Body) ToInt64() (int64, error)

* * ToInt64 returns an integer * @return int64 *

func (Body) ToJson added in v1.0.22

func (b Body) ToJson() (et.Json, error)

* * ToJson returns a Json object * @return et.Json *

func (Body) ToString added in v1.0.22

func (b Body) ToString() string

* * ToString returns a string * @return string *

func (Body) ToTime added in v1.0.22

func (b Body) ToTime() (time.Time, error)

* * ToTime returns a time * @return time.Time *

type Status added in v0.0.151

type Status struct {
	Ok      bool   `json:"ok"`
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func (Status) ToJson added in v0.0.157

func (s Status) ToJson() et.Json

ToJson returns a Json object

func (Status) ToString added in v0.0.157

func (s Status) ToString() string

ToString returns a string

Jump to

Keyboard shortcuts

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