{"id":22962324,"url":"https://github.com/zonble/curldsl","last_synced_at":"2025-07-27T04:05:52.263Z","repository":{"id":56906888,"uuid":"200374646","full_name":"zonble/CurlDSL","owner":"zonble","description":"CurlDSL converts cURL commands into URLRequest objects","archived":false,"fork":false,"pushed_at":"2021-11-19T14:39:21.000Z","size":164,"stargazers_count":69,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-14T16:47:02.370Z","etag":null,"topics":["curl","dsl","ios","networking","swift"],"latest_commit_sha":null,"homepage":"https://zonble.github.io/CurlDSL","language":"Swift","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/zonble.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}},"created_at":"2019-08-03T12:45:43.000Z","updated_at":"2024-11-07T20:39:08.000Z","dependencies_parsed_at":"2022-08-21T03:50:14.080Z","dependency_job_id":null,"html_url":"https://github.com/zonble/CurlDSL","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonble%2FCurlDSL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonble%2FCurlDSL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonble%2FCurlDSL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonble%2FCurlDSL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zonble","download_url":"https://codeload.github.com/zonble/CurlDSL/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229743813,"owners_count":18117460,"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","dsl","ios","networking","swift"],"created_at":"2024-12-14T19:16:33.336Z","updated_at":"2024-12-14T19:16:33.983Z","avatar_url":"https://github.com/zonble.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CurlDSL\n\n2019 © Weizhong Yang a.k.a zonble\n\n[![Actions Status](https://github.com/zonble/CurlDSL/workflows/Build/badge.svg)](https://github.com/zonble/CurlDSL/actions)\n\nCurlDSL converts cURL commands into `URLRequest` objects. The Swift package\nhelps you to build HTTP clients in your iOS/macOS/tvOS easier, once you have a\ncURL command example for a Web API endpoint.\n\nCurlDSL does not embed cURL library into your project. It is also not a Swift\ncode generator, but it is a simple interpreter, it parses and interprets your\ncURL command at run time.\n\nThe project is inspired by [cURL as DSL](https://github.com/shibukawa/curl_as_dsl)\nby [Yoshiki Shibukawa](https://github.com/shibukawa).\n\nCurlDSL supports only HTTP and HTTPS right now.\n\n## Requirement\n\n- Swift 5.1 or above\n- iOS 13 or above\n- macOS 10.15 or above\n- tvOS 13 or above\n\n## Installation\n\nYou can install the package via [Swift Package Manager](https://swift.org/package-manager/).\n\n## Usage\n\nThere is only one important object, `CURL`. You can just pass your cURL command\nto it. For example:\n\n``` swift\ntry CURL(\"curl -X GET https://httpbin.org/json\")\n```\n\nYou can use it to build `URLRequest` objects.\n\n``` swift\nlet request = try? CURL(\"curl -X GET https://httpbin.org/json\").buildRequest()\n```\n\nOr jsut run the data task:\n\n``` swift\ntry CURL(\"https://httpbin.org/json\").run { data, response, error in\n    /// Do what you like...\n}\n```\n\n## Supported Options\n\nWe do not support all of options of cURL. The supported options are as the\nfollowing list.\n\n``` text\n   -d, --data=DATA                         HTTP POST data (H)\n   -F, --form=KEY=VALUE                    Specify HTTP multipart POST data (H)\n       --form-string=KEY=VALUE             Specify HTTP multipart POST data (H)\n   -H, --header=LINE                       Pass custom header LINE to server (H)\n   -e, --referer=                          Referer URL (H)\n   -X, --request=COMMAND                   Specify request command to use\n       --url=URL                           URL to work with\n   -u, --user=USER[:PASSWORD]              Server user and password\n   -A, --user-agent=STRING                 User-Agent to send to server (H)\n```\n\n## Built-in Response Handlers\n\nThe package has several built-in handlers:\n\n- `JsonDictionaryHandler`: Decodes fetched JSON data into a dictionary.\n- `CodableHandler`: Decodes fetched JSON data into Codable objects.\n- `DataHandler`: Simply returns raw data.\n\n## License\n\nThe package is released under MIT license.\n\nPull requests are welcome.\n\nEnjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzonble%2Fcurldsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzonble%2Fcurldsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzonble%2Fcurldsl/lists"}