https://github.com/rohanraj7316/httpclient
basic http client with id tagging, req, resp and req/res body tagging
https://github.com/rohanraj7316/httpclient
golang http
Last synced: 3 months ago
JSON representation
basic http client with id tagging, req, resp and req/res body tagging
- Host: GitHub
- URL: https://github.com/rohanraj7316/httpclient
- Owner: rohanraj7316
- License: mit
- Created: 2022-02-01T16:18:33.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-30T08:26:52.000Z (almost 4 years ago)
- Last Synced: 2023-07-27T22:35:25.309Z (over 2 years ago)
- Topics: golang, http
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# httpclient
http request client with in build request and response logging.
## Integration
either you can import default config and edit it out according to your needs or you can use `Config` struct to create your own config. for example:
```
// passing the config as nil.
// internally http client uses
// default config
client, err := httpclient.New()
if err != nil {
log.Println(err)
}
```
or
```
// initialize the config
hConfig := httpclient.Config{
Timeout: 10 * time.Second,
}
// passing the http config while creating new http client
client, err := httpclient.New(hConfig...)
if err != nil {
log.Println(err)
}
```
then you can use this client inside your code.
## Example
below are the examples which gonna help you to get started with the the integration.
[example](example/)