Discover Packages
github.com/Kieraya/shazam
package
module
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Feb 16, 2023
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
README
README
¶
shazam ⚡️
Just a safe and better http to curl for golang
shazam
is a plugin which is used to print curl for your HTTP requests, in pre-flight scenarios.
The word safe is used here, as shazam
implements a naïve technique to protect sensitive request pointers.
TL;DR
Import shazam
in your code.
go get github.com/Kieraya/shazam
Add the following to your code.
...
request, err := http.NewRequest(http.MethodGet, url, nil)
// handle error
curl, err := shazam.Boom(request)
if err != nil {
log.Println(err)
}
log.Println(curl)
..
That's it ! You should see something like this:
curl --location --request GET 'https://reqres.in/api/users?page=2' --header 'x-panem-token: BUM99779r42aUZUZB8Z95YLK'
Thanks and have fun. Happy hacking !
Expand ▾
Collapse ▴
Documentation
¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.