cURL to Go

Paste a cURL command and convert it to Go net/http code in the browser. Methods, headers, and request bodies are mapped into a small main package you can run or adapt.

cURL to: Java JavaScript Python PHP C# Go

About cURL to Go

Convert a cURL command to Go online and get a small net/http main package with NewRequest, headers, and a body reader. This free cURL to Go converter is for moving a captured call into a Go service or a throwaway program.

Standard methods use http.MethodGet and friends. Request bodies use strings.NewReader. The response status and body are printed so the snippet is runnable after you add a module.

Go developers paste cURL from docs or a gateway log and keep the same headers. Switch to Python or JavaScript when the next consumer is not Go.

The conversion stays in your browser. Use this free cURL to Go converter whenever you need net/http code from a cURL command.