Discover Packages
github.com/aditya109/atomic
package
module
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Nov 10, 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
¶
atomic ⚡️
Just a safe and better http-to-curl for golang
atomic
is a plugin which is used to print curl for your HTTP requests, in pre-flight scenarios.
The word safe is used here, as atomic
implements a naïve technique to protect sensitive request pointers.
How to get started ?
Import atomic
in your code.
go get github.com/Kieraya/atomic
Add the following to your code.
...
request, err := http.NewRequest(http.MethodGet, url, nil)
// handle error
curl, err := atomic.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
¶
Boom take *http.Request and provides string giving a curl for in-usage request
Source Files
¶
Click to show internal directories.
Click to hide internal directories.