SkillAgentSearch skills...

Gorequests

No description available

Install / Use

/learn @chyroc/Gorequests
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

gorequests

codecov go report card test status Apache-2.0 license Go.Dev reference Go project version

Simple and easy-to-use go http client, supports cookies, streaming calls, custom logs and other functions

Install

go get github.com/chyroc/gorequests

Usage

Simple Send Request

func main() {
	text, err := gorequests.New(http.MethodGet, "https://jsonplaceholder.typicode.com/todos/1").Text()
	if err != nil {
		panic(err)
	}
	fmt.Println("text", text)
}

Send Request With Cookie

func main() {
	session := gorequests.NewSession("/tmp/gorequests-session.txt")
	text, err := session.New(http.MethodGet, "https://jsonplaceholder.typicode.com/todos/1").Text()
	if err != nil {
		panic(err)
	}
	fmt.Println("text", text)
}

Request Factory

func main() {
    fac := gorequests.NewFactory(
        gorequests.WithLogger(gorequests.NewDiscardLogger()),
    )
	text, err := fac.New(http.MethodGet, "https://jsonplaceholder.typicode.com/todos/1").Text()
	if err != nil {
		panic(err)
	}
	fmt.Println("text", text)
}

Related Skills

View on GitHub
GitHub Stars4
CategoryDevelopment
Updated2y ago
Forks6

Languages

Go

Security Score

65/100

Audited on Feb 5, 2024

No findings