gorequests

package module
v0.0.0-...-e91c11c Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 0 Imported by: 0

README

go-requests

Examples


use in your project

go get github.com/1oid/gorequests

request something

func main() {
    request := models.Request{
        Method: "POST",
        Url:    "https://www.baidu.com",
        Proxy:  "http://127.0.0.1:8080",
        Headers: map[string]string{
            "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
        },
        Data: []byte("niu=1"),
    }
    response := request.DoReq()
    fmt.Println(response.StatusCode)
    fmt.Println(string(response.Body))
    
    fmt.Println("======Request Raw======")
    fmt.Println(request.RequestRaw)
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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