{"id":14989927,"url":"https://github.com/aoliveti/curling","last_synced_at":"2025-07-04T00:33:40.958Z","repository":{"id":225350231,"uuid":"764537177","full_name":"aoliveti/curling","owner":"aoliveti","description":"Curling is a Go library that converts Go HTTP requests into cURL commands","archived":false,"fork":false,"pushed_at":"2024-11-07T08:37:25.000Z","size":70,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T07:11:22.618Z","etag":null,"topics":["curl","curl-commands","go","golang","http","http-requests"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aoliveti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-02-28T09:02:13.000Z","updated_at":"2025-03-29T14:49:37.000Z","dependencies_parsed_at":"2024-03-04T17:00:03.055Z","dependency_job_id":"fd9e2315-29e6-48b0-9f50-41d83be2dc33","html_url":"https://github.com/aoliveti/curling","commit_stats":null,"previous_names":["aoliveti/curling"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/aoliveti/curling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoliveti%2Fcurling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoliveti%2Fcurling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoliveti%2Fcurling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoliveti%2Fcurling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aoliveti","download_url":"https://codeload.github.com/aoliveti/curling/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoliveti%2Fcurling/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263426113,"owners_count":23464793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["curl","curl-commands","go","golang","http","http-requests"],"created_at":"2024-09-24T14:19:08.823Z","updated_at":"2025-07-04T00:33:40.907Z","avatar_url":"https://github.com/aoliveti.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![curling logo](assets/images/logo.png)\n\n# curling\n\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/aoliveti/curling)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/aoliveti/curling/go.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/aoliveti/curling)](https://pkg.go.dev/github.com/aoliveti/curling)\n[![codecov](https://codecov.io/gh/aoliveti/curling/graph/badge.svg?token=3L9FOZMEJH)](https://codecov.io/gh/aoliveti/curling)\n[![Go Report Card](https://goreportcard.com/badge/github.com/aoliveti/curling)](https://goreportcard.com/report/github.com/aoliveti/curling)\n![GitHub License](https://img.shields.io/github/license/aoliveti/curling)\n\nCurling is a Go library that converts [http.Request](https://pkg.go.dev/net/http#Request) objects\ninto [cURL](https://curl.se/) commands\n\n## Install\n\n```sh\ngo get -u github.com/aoliveti/curling\n```\n\n## Usage\n\nThe following Go code demonstrates how to create a command from an HTTP request object:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/aoliveti/curling\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(http.MethodGet, \"https://www.google.com\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treq.Header.Add(\"If-None-Match\", \"foo\")\n\n\tcmd, err := curling.NewFromRequest(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Println(cmd)\n}\n```\n\n```sh\ncurl -X 'GET' 'https://www.google.com' -H 'If-None-Match: foo'\n```\n\n### Options\n\n```go\nfunc NewFromRequest(r *http.Request, opts ...Option) (*Command, error) {\n    ...\n}\n```\n\nWhen creating a new command, you can provide these options:\n\n| Option                          | Description                                       |\n|---------------------------------|---------------------------------------------------|\n| WithLongForm()                  | Enables the long form for cURL options            |\n| WithFollowRedirects()           | Sets the flag -L, --location                      |\n| WithInsecure()                  | Sets the flag -k, --insecure                      |\n| WithSilent()                    | Sets the flag -s, --silent                        |\n| WithCompressed()                | Sets the flag --compressed                        |\n| WithMultiLine()                 | Generates a multiline snippet for unix-like shell |\n| WithWindowsMultiLine()          | Generates a multiline snippet for Windows shell   |\n| WithPowerShellMultiLine()       | Generates a multiline snippet for PowerShell      |\n| WithDoubleQuotes()              | Uses double quotes to escape characters           |\n| WithRequestTimeout(seconds int) | Sets the flag -m, --max-time                      |\n\n## License\n\nThe library is released under the MIT license. See [LICENSE](LICENSE) file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoliveti%2Fcurling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faoliveti%2Fcurling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoliveti%2Fcurling/lists"}