package exfmt
import "go.mau.fi/util/exfmt"
Index ¶
- Variables
- func Duration(d time.Duration) string
- func FormatCurl(cli *http.Client, req *http.Request) string
Variables ¶
var Week = 7 * Day
Functions ¶
func Duration ¶
func FormatCurl ¶
FormatCurl formats the given HTTP request as a curl command.
This will include all headers, and also the request body if GetBody is set. Notes:
* Header names are quoted using fmt.Sprintf, so it may not always be correct for shell quoting. * The URL is only quoted and not escaped, so URLs with single quotes will not currently work.
The client parameter is optional and is used to find cookies from the cookie jar.
Source Files ¶
curl.go duration.go
- Version
- v0.4.2
- Published
- Apr 16, 2024
- Platform
- darwin/amd64
- Imports
- 7 packages
- Last checked
- 3 hours ago –
Tools for package owners.