Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/superbrothers/httpdebugger
This is an http.RoundTripper that will display information about the requests passing through it based on what is configured.
https://github.com/superbrothers/httpdebugger
Last synced: about 1 month ago
JSON representation
This is an http.RoundTripper that will display information about the requests passing through it based on what is configured.
- Host: GitHub
- URL: https://github.com/superbrothers/httpdebugger
- Owner: superbrothers
- License: other
- Created: 2017-01-29T14:02:54.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-29T14:18:06.000Z (almost 8 years ago)
- Last Synced: 2024-06-20T00:32:49.256Z (5 months ago)
- Language: Go
- Homepage:
- Size: 39.1 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# httpdebugger
This is an [http.RoundTripper](https://golang.org/pkg/net/http/#RoundTripper) that will display information about the requests passing through it based on what is configured.
httpdebugger is created based on [k8s.io/client-go/transport/round_trippers.go](https://github.com/kubernetes/client-go/blob/master/transport/round_trippers.go)
## Example
![example](./screenshots/example.png)
```go
package mainimport (
"net/http""github.com/sirupsen/logrus"
"github.com/superbrothers/httpdebugger"
)var log = logrus.New()
func main() {
w := log.Writer()
defer w.Close()client := &http.Client{
Transport: httpdebugger.NewDebuggingRoundTripper(
&http.Transport{},
w,
httpdebugger.JustURL,
httpdebugger.URLTiming,
httpdebugger.CurlCommand,
httpdebugger.RequestHeaders,
httpdebugger.ResponseStatus,
httpdebugger.ResponseHeaders,
),
}if _, err := client.Get("https://kubernetes.io/"); err != nil {
log.Fatal(err)
}
}
```## License
This software is released under the MIT License and includes the work that is distributed in the Apache License 2.0.