https://github.com/tbdsux/reqgo
A simple wrapper for go http requests
https://github.com/tbdsux/reqgo
go go-http go-requests golang http-requests requests
Last synced: 28 days ago
JSON representation
A simple wrapper for go http requests
- Host: GitHub
- URL: https://github.com/tbdsux/reqgo
- Owner: tbdsux
- License: mit
- Created: 2023-04-12T12:45:37.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-20T05:51:48.000Z (about 3 years ago)
- Last Synced: 2025-12-17T10:34:28.032Z (6 months ago)
- Topics: go, go-http, go-requests, golang, http-requests, requests
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# reqgo
A simple wrapper for http requests
> Library is very much incomplete, its only purpose is for handling basic / normal http requests. Please use the default `net/http` package for more complex and control over the request
## Install
```sh
go get -u github.com/tbdsux/reqgo
```
## Usage
API is based from python's `requests` module and node's `fetch` api.
```go
package main
import (
"fmt"
"log"
"github.com/tbdsux/reqgo"
)
func main() {
r, err := reqgo.Get("https://httpbin.org/get", &reqgo.Options{
Headers: reqgo.Headers{
"Custom-Header": "hello world",
},
})
if err != nil {
log.Fatalln(err)
}
var data map[string]interface{}
if err := r.JSON(&data); err != nil {
log.Fatalln(err)
}
fmt.Println(data["headers"])
}
```
##
**© 2023 | tbdsux**