https://github.com/goreq/goreq
Simple HTTP client for Go
https://github.com/goreq/goreq
go hacktoberfest http
Last synced: 19 days ago
JSON representation
Simple HTTP client for Go
- Host: GitHub
- URL: https://github.com/goreq/goreq
- Owner: goreq
- License: gpl-3.0
- Created: 2022-01-14T04:16:01.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-13T14:16:45.000Z (over 3 years ago)
- Last Synced: 2024-06-20T00:30:24.639Z (almost 2 years ago)
- Topics: go, hacktoberfest, http
- Language: Go
- Homepage:
- Size: 83 KB
- Stars: 11
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# GoReq (Go Requester)
Simple HTTP client for Go
[](https://goreportcard.com/report/github.com/goreq/goreq)
* [Documentation](https://pkg.go.dev/github.com/goreq/goreq)
* [Coverage](https://gocover.io/github.com/goreq/goreq)
* [Examples](https://github.com/goreq/example)
# Example
```go
resp, err := goreq.Get("https://api.products.com/entities")
if err != nil {
panic(err)
}
defer resp.Body.Close()
// do anything with the resp object
```
or, using base URL like this
```go
g := goreq.New(
gore.WithBaseURL("https://api.products.com"),
)
resp, err := g.Get("/entities")
if err != nil {
panic(err)
}
defer resp.Body.Close()
// do anything with the resp object
```
> more examples, see [https://github.com/goreq/example](https://github.com/goreq/example)
# Key Concept
* Reusable, prevent options rewrite using single object for multiple request
* Flexible, because it use raw response object
# Contributing
Let's code together by following [Contributing Guidelines](./CONTRIBUTING.md)
# License
This library under the [GNU General Public License v3.0](./LICENSE)