Compressed flag
Fix readme
Syntax in README
Very simple tool that stickytapes a shell parser to stdin and quacks out some code to drive an HTTP client.
Can save a lot of time when using browser dev tools.
Example:
echo "curl --request GET \
--url http://invalid/path \
--user-agent 'FLEEB' \
--header 'A: B C'" \
| curl2code
Output:
client := http.Client{
Timeout: 10 * time.Second,
}
rq, err := http.NewRequest("GET", "http://invalid/path", nil)
if err != nil {
return err
}
rq.Header.Set("User-Agent", "FLEEB")
rq.Header.Set("A", "B C")
rs, err := client.Do(rq)
if err != nil {
return err
}
This is a tool I hack on for my own amusement in an ad-hoc fashion. No stability guarantees are made, the code is not guaranteed to work, and anything may be changed, renamed or removed at any time as I see fit.
If you wish to use any of this, I strongly recommend you copy-paste pieces as-needed (including tests and license/attribution) into your own project, or fork it for your own purposes.
Bug reports are welcome, feature requests discouraged, and code contributions will not be accepted.