Categorygithub.com/sari3l/requests
modulepackage
1.1.17
Repository: https://github.com/sari3l/requests.git
Documentation: pkg.go.dev

# README

Requests

Go Report Card CodeFactor FOSSA Status

Logo

Install

go get github.com/sari3l/requests

Demo

import (
    "fmt"
    "github.com/sari3l/requests"
    "github.com/sari3l/requests/ext"
    "github.com/sari3l/requests/types"
)

func main() {
    // Requests Bearer Token
    auth := types.BasicAuth{Username: "o94KGT3MlbT...", Password: "fNbL2ukEGyvuGSM7bAuoq..."}
    data := types.Dict{
        "grant_type": "client_credentials",
    }
    resp := requests.Post("https://api.twitter.com/oauth2/token", ext.Auth(auth), ext.Data(data))
    
    // Requests with Twitter API 2.0
    if resp != nil && resp.Ok {
        fmt.Println(resp.Json())
        token := types.BearerAuth{Token: resp.Json().Get("access_token").Str}
        resp2 := requests.Get("https://api.twitter.com/2/users/by/username/Sariel_D", ext.Auth(token))
        fmt.Println(resp2.Json())
    }
}

Document

Licenses

MIT License

FOSSA Status

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Post
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

time.Second.
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author