curl-to-Go

Instantly convert curl commands to Go code

This tool turns a curl command into Go code. Currently, it knows the following options: -d/--data, -H/--header, -I/--head, -u/--user, and -X/--request. It also understands JSON content types. As always, be sure to go fmt your code and pay attention to imports. For a quick way to generate a Go struct from JSON, see JSON-to-Go. There's probably bugs; please contribute on GitHub!

Example 1 · Example 2 · Example 3 · Example 4 · Example 5