https://github.com/teran/go-http-client
HTTP Client for Go to ease interaction with web services, especially APIs
https://github.com/teran/go-http-client
go golang http http-client httpclient
Last synced: 4 months ago
JSON representation
HTTP Client for Go to ease interaction with web services, especially APIs
- Host: GitHub
- URL: https://github.com/teran/go-http-client
- Owner: teran
- License: apache-2.0
- Created: 2024-03-29T20:42:07.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-13T06:48:35.000Z (4 months ago)
- Last Synced: 2025-03-13T07:37:30.519Z (4 months ago)
- Topics: go, golang, http, http-client, httpclient
- Language: Go
- Homepage:
- Size: 65.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-http-client
## Migration notice
This library is moved to [go-collection](https://github.com/teran/go-collection)
repository for unified experience and simplifying maintenance process.
This repository will **not** be deleted for backward compatibility.[](https://github.com/teran/go-http-client/actions/workflows/go.yml)
[](https://goreportcard.com/report/github.com/teran/go-http-client)
[](https://pkg.go.dev/github.com/teran/go-http-client)HTTP Client for Go to ease interaction with web services, especially APIs
## Usage example
```go
package mainimport (
"fmt""github.com/pkg/errors"
ghc "github.com/teran/go-http-client"
)// FIXME: Change this to your test JSON URL
const testURL = "http://........."func main() {
resp := map[string]string{}
errResp := map[string]string{}
statusCode, err := ghc.New().
Base(testURL).
Get("/json").
DoJSON(s.ctx, nil, &resp, &errResp)
if err != nil {
panic(errors.Wrap(err, fmt.Sprintf("%#v", errResp)))
}fmt.Printf("%#v", resp)
}```