cURL to Go
Paste a cURL command below.
Paste a cURL command and convert it into Go net/http code. Builds the request, sets headers, handles basic auth and prints the response.
Paste a cURL command below.
The parser extracts the method, URL, headers and body, then emits a complete Go program: http.NewRequest with a strings.Reader body, Header.Set calls, SetBasicAuth for -u, and a DefaultClient.Do with the response printed to stdout.
The output is a full package main program, not a snippet. Save it as main.go and run go run main.go to replay the request immediately, which is handy for backend debugging.