{"id":13608093,"url":"https://github.com/olsh/curl-to-csharp","last_synced_at":"2025-10-17T10:58:52.980Z","repository":{"id":34281939,"uuid":"137327177","full_name":"olsh/curl-to-csharp","owner":"olsh","description":"curl to C# converter","archived":false,"fork":false,"pushed_at":"2025-05-01T14:31:51.000Z","size":1376,"stargazers_count":224,"open_issues_count":16,"forks_count":40,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-10T15:41:17.322Z","etag":null,"topics":["converter","csharp","curl","roslyn"],"latest_commit_sha":null,"homepage":"https://curl.olsh.me","language":"C#","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/olsh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["olsh"]}},"created_at":"2018-06-14T08:11:25.000Z","updated_at":"2025-04-12T06:27:18.000Z","dependencies_parsed_at":"2023-12-01T15:31:02.834Z","dependency_job_id":"27465b9e-6fb9-4012-a27e-b237fb822959","html_url":"https://github.com/olsh/curl-to-csharp","commit_stats":{"total_commits":324,"total_committers":4,"mean_commits":81.0,"dds":0.4320987654320988,"last_synced_commit":"1da4500df3148191655b5f1680fc15d3e1868804"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsh%2Fcurl-to-csharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsh%2Fcurl-to-csharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsh%2Fcurl-to-csharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsh%2Fcurl-to-csharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olsh","download_url":"https://codeload.github.com/olsh/curl-to-csharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310515,"owners_count":22049469,"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":["converter","csharp","curl","roslyn"],"created_at":"2024-08-01T19:01:24.205Z","updated_at":"2025-10-17T10:58:47.924Z","avatar_url":"https://github.com/olsh.png","language":"C#","funding_links":["https://github.com/sponsors/olsh"],"categories":["csharp","C# #","C\\#"],"sub_categories":[],"readme":"# curl to C#\n[![Build status](https://ci.appveyor.com/api/projects/status/rfdgvqb9x0dwddy8?svg=true)](https://ci.appveyor.com/project/olsh/curl-to-csharp)\n[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=curl-to-csharp\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=curl-to-csharp)\n[![Docker pulls](https://img.shields.io/docker/pulls/olsh/curl-to-csharp)](https://hub.docker.com/r/olsh/curl-to-csharp)\n\nThis ASP.NET Core app converts curl commands to C# code\n\n## Demo\n\nhttps://curl.olsh.me\n\n## Telegram bot\n\nhttps://t.me/curl_to_csharp_bot\n\n## Run with docker\n\n1. Run container\n\n```bash\ndocker run -p 8080:8080 olsh/curl-to-csharp\n```\n\n2. Open http://localhost:8080\n\n## Run locally\n\nYou can grab latest binaries [here](https://ci.appveyor.com/project/olsh/curl-to-csharp/build/artifacts) and run `dotnet CurlToCSharp.dll`\n\n## Build\n\n1. Install cake\n\n```bash\ndotnet tool install -g Cake.Tool\n```\n\n2. Run build\n\n```bash\ndotnet cake build.cake\n```\n\n## NuGet Packages\n### Curl.CommandLine.Parser\n[![NuGet](https://img.shields.io/nuget/v/Curl.CommandLine.Parser.svg)](https://www.nuget.org/packages/Curl.CommandLine.Parser/)\n\n#### Key Features\n- Parses cURL command into individual cURL options.\n- Returns parsing errors and warnings if the cURL input is invalid.\n\n#### Installation\nInstall with NuGet\n```cmd\ndotnet add package Curl.CommandLine.Parser\n```\n\n#### Usage/Examples\n```c#\nvar input = @\"curl https://sentry.io/api/0/projects/1/groups/?status=unresolved -d '{\"\"status\"\": \"\"resolved\"\"}' -H 'Content-Type: application/json' -u 'username:password' -H 'Accept: application/json' -H 'User-Agent: curl/7.60.0'\";\n\nvar output = new CurlParser(new ParsingOptions() { MaxUploadFiles = 10 }).Parse(input);\n\nConsole.WriteLine(output.Data.UploadData.First().Content);\n// Output:\n// {\"status\": \"resolved\"}\n```\n\n### Curl.HttpClient.Converter\n[![NuGet](https://img.shields.io/nuget/v/Curl.HttpClient.Converter.svg)](https://www.nuget.org/packages/Curl.HttpClient.Converter/)\n#### Key Features\n- Converts output from CurlParser into C# code.\n- Returns parsing errors and warnings if the cURL input is invalid.\n\n#### Installation\nInstall with NuGet\n```cmd\ndotnet add package Curl.HttpClient.Converter\n```\n\n#### Usage/Examples\n```c#\nvar input = @\"curl https://sentry.io/api/0/projects/1/groups/?status=unresolved -d '{\"\"status\"\": \"\"resolved\"\"}' -H 'Content-Type: application/json' -u 'username:password' -H 'Accept: application/json' -H 'User-Agent: curl/7.60.0'\";\nvar curlOption = new CurlParser().Parse(input);\nvar output = new CurlHttpClientConverter().ToCsharp(curlOption.Data);\n// Output:\n/*\n// In production code, don't destroy the HttpClient through using, but better reuse an existing instance\n// https://www.aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/\nusing (var httpClient = new HttpClient())\n{\n    using (var request = new HttpRequestMessage(new HttpMethod(\"POST\"), \"https://sentry.io/api/0/projects/1/groups/?status=unresolved\"))\n    {\n        request.Headers.TryAddWithoutValidation(\"Accept\", \"application/json\");\n        request.Headers.TryAddWithoutValidation(\"User-Agent\", \"curl/7.60.0\");\n\n        var base64authorization = Convert.ToBase64String(Encoding.ASCII.GetBytes(\"username:password\"));\n        request.Headers.TryAddWithoutValidation(\"Authorization\", $\"Basic {base64authorization}\");\n\n        request.Content = new StringContent(\"{\\\"status\\\": \\\"resolved\\\"}\");\n        request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(\"application/json\");\n\n        var response = await httpClient.SendAsync(request);\n    }\n}\n*/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folsh%2Fcurl-to-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folsh%2Fcurl-to-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folsh%2Fcurl-to-csharp/lists"}