{"id":13296756,"url":"https://github.com/1995parham-learning/goURL","last_synced_at":"2025-03-10T09:32:02.539Z","repository":{"id":113152655,"uuid":"344492021","full_name":"1995parham-learning/goURL","owner":"1995parham-learning","description":"curl clone in go","archived":false,"fork":false,"pushed_at":"2023-12-18T21:35:34.000Z","size":564,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-29T17:46:22.981Z","etag":null,"topics":["curl","go-http","http-client"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1995parham-learning.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}},"created_at":"2021-03-04T13:55:44.000Z","updated_at":"2024-07-29T17:46:29.085Z","dependencies_parsed_at":null,"dependency_job_id":"a815cf13-f695-439f-987d-1e4c2fb0a265","html_url":"https://github.com/1995parham-learning/goURL","commit_stats":null,"previous_names":["1995parham-learning/gourl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1995parham-learning%2FgoURL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1995parham-learning%2FgoURL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1995parham-learning%2FgoURL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1995parham-learning%2FgoURL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1995parham-learning","download_url":"https://codeload.github.com/1995parham-learning/goURL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221164260,"owners_count":16767293,"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","go-http","http-client"],"created_at":"2024-07-29T17:21:07.488Z","updated_at":"2024-10-23T06:30:25.313Z","avatar_url":"https://github.com/1995parham-learning.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go URL\n\n## Introduction\n\n`gourl` simulate `curl` behavior in Go.\n\n## How To Run\n\n```bash\njust build\n```\n\n## Examples\n\nThese are examples of using `gourl` in different situations.\n\n- GET Request\n\n```bash\n./gourl https://httpbin.org/get\n```\n\n```log\nINFO[0000] sending request into https://httpbin.org/get\nINFO[0000] Method is: GET\nINFO[0000] Response status: 200 OK\nINFO[0000] headers are:\nINFO[0000] Date = [Tue, 30 Mar 2021 15:40:08 GMT]\nINFO[0000] Content-Type = [application/json]\nINFO[0000] Content-Length = [273]\nINFO[0000] Server = [gunicorn/19.9.0]\nINFO[0000] Access-Control-Allow-Origin = [*]\nINFO[0000] Access-Control-Allow-Credentials = [true]\n{\n  \"args\": {},\n  \"headers\": {\n    \"Accept-Encoding\": \"gzip\",\n    \"Host\": \"httpbin.org\",\n    \"User-Agent\": \"Go-http-client/2.0\",\n    \"X-Amzn-Trace-Id\": \"Root=1-60634658-7e2795bc70bfe6e7286c4f0d\"\n  },\n  \"origin\": \"94.139.160.188\",\n  \"url\": \"https://httpbin.org/get\"\n}\n```\n\n- POST Request with JSON body and `Content-Type` automatically is set to `application/json`.\n\n```bash\n./gourl https://httpbin.org/post -X POST -j '{ \"hello\": \"world\" }'\n```\n\n```log\nINFO[0000] sending request into https://httpbin.org/post\nINFO[0001] Method is: POST\nINFO[0001] Response status: 200 OK\nINFO[0001] headers are:\nINFO[0001] Content-Length = [453]\nINFO[0001] Server = [gunicorn/19.9.0]\nINFO[0001] Access-Control-Allow-Origin = [*]\nINFO[0001] Access-Control-Allow-Credentials = [true]\nINFO[0001] Date = [Tue, 30 Mar 2021 15:43:37 GMT]\nINFO[0001] Content-Type = [application/json]\n{\n  \"args\": {},\n  \"data\": \"{ \\\"hello\\\": \\\"world\\\" }\",\n  \"files\": {},\n  \"form\": {},\n  \"headers\": {\n    \"Accept-Encoding\": \"gzip\",\n    \"Content-Length\": \"20\",\n    \"Content-Type\": \"application/json\",\n    \"Host\": \"httpbin.org\",\n    \"User-Agent\": \"Go-http-client/2.0\",\n    \"X-Amzn-Trace-Id\": \"Root=1-60634729-41ac79314b2e7c9775a86f39\"\n  },\n  \"json\": {\n    \"hello\": \"world\"\n  },\n  \"origin\": \"94.139.160.188\",\n  \"url\": \"https://httpbin.org/post\"\n}\n```\n\n- POST Request with Form body and `Content-Type` automatically is set to `application/x-www-form-urlencoded`.\n\n```bash\n./gourl https://httpbin.org/post -X POST -d 'hello=world'\n```\n\n```log\nINFO[0000] sending request into https://httpbin.org/post\nINFO[0001] Method is: POST\nINFO[0001] Response status: 200 OK\nINFO[0001] headers are:\nINFO[0001] Date = [Tue, 30 Mar 2021 15:44:52 GMT]\nINFO[0001] Content-Type = [application/json]\nINFO[0001] Content-Length = [448]\nINFO[0001] Server = [gunicorn/19.9.0]\nINFO[0001] Access-Control-Allow-Origin = [*]\nINFO[0001] Access-Control-Allow-Credentials = [true]\n{\n  \"args\": {},\n  \"data\": \"\",\n  \"files\": {},\n  \"form\": {\n    \"hello\": \"world\"\n  },\n  \"headers\": {\n    \"Accept-Encoding\": \"gzip\",\n    \"Content-Length\": \"11\",\n    \"Content-Type\": \"application/x-www-form-urlencoded\",\n    \"Host\": \"httpbin.org\",\n    \"User-Agent\": \"Go-http-client/2.0\",\n    \"X-Amzn-Trace-Id\": \"Root=1-60634774-4bc210632c9ea0bd2c0ccce0\"\n  },\n  \"json\": null,\n  \"origin\": \"94.139.160.188\",\n  \"url\": \"https://httpbin.org/post\"\n}\n```\n\n- GET Request with Query Strings\n\n```bash\n./gourl https://httpbin.org/get -X GET -Q 'hello=world' -Q 'salam=donya'\n```\n\n```log\nINFO[0000] sending request into https://httpbin.org/get?hello=world\u0026salam=donya\nINFO[0001] Method is: GET\nINFO[0001] Response status: 200 OK\nINFO[0001] headers are:\nINFO[0001] Date = [Tue, 30 Mar 2021 15:48:31 GMT]\nINFO[0001] Content-Type = [application/json]\nINFO[0001] Content-Length = [344]\nINFO[0001] Server = [gunicorn/19.9.0]\nINFO[0001] Access-Control-Allow-Origin = [*]\nINFO[0001] Access-Control-Allow-Credentials = [true]\n{\n  \"args\": {\n    \"hello\": \"world\",\n    \"salam\": \"donya\"\n  },\n  \"headers\": {\n    \"Accept-Encoding\": \"gzip\",\n    \"Host\": \"httpbin.org\",\n    \"User-Agent\": \"Go-http-client/2.0\",\n    \"X-Amzn-Trace-Id\": \"Root=1-6063484f-15f9b9f903601d420c6fb621\"\n  },\n  \"origin\": \"94.139.160.188\",\n  \"url\": \"https://httpbin.org/get?hello=world\u0026salam=donya\"\n}\n```\n\n- Invalid Request\n\n```bash\n./gourl httpj://httpbin.org/\n```\n\n```log\nINFO[0000] sending request into httpj://httpbin.org/\nERRO[0000] request failed: Get \"httpj://httpbin.org/\": unsupported protocol scheme \"httpj\"\n```\n\n- Invalid JSON Body\n\n```bash\n./gourl https://httpbin.org/post -X POST -j '{ \"hello\": \"world }'\n```\n\n```log\nERRO[0000] your body is not in the json format: unexpected end of JSON input\nINFO[0000] sending request into https://httpbin.org/post\nINFO[0001] Method is: POST\nINFO[0001] Response status: 200 OK\nINFO[0001] headers are:\nINFO[0001] Date = [Tue, 30 Mar 2021 15:51:26 GMT]\nINFO[0001] Content-Type = [application/json]\nINFO[0001] Content-Length = [429]\nINFO[0001] Server = [gunicorn/19.9.0]\nINFO[0001] Access-Control-Allow-Origin = [*]\nINFO[0001] Access-Control-Allow-Credentials = [true]\n{\n  \"args\": {},\n  \"data\": \"{ \\\"hello\\\": \\\"world }\",\n  \"files\": {},\n  \"form\": {},\n  \"headers\": {\n    \"Accept-Encoding\": \"gzip\",\n    \"Content-Length\": \"19\",\n    \"Content-Type\": \"application/json\",\n    \"Host\": \"httpbin.org\",\n    \"User-Agent\": \"Go-http-client/2.0\",\n    \"X-Amzn-Trace-Id\": \"Root=1-606348fe-2741175600ec1e5706a0b4cb\"\n  },\n  \"json\": null,\n  \"origin\": \"94.139.160.188\",\n  \"url\": \"https://httpbin.org/post\"\n}\n```\n\n- Timeout (do not wait for headers)\n\n```bash\n./gourl https://httpbin.org/delay/10 -t 1s\n```\n\n```log\nINFO[0000] sending request into https://httpbin.org/delay/10\nERRO[0001] request failed: Get \"https://httpbin.org/delay/10\": http2: timeout awaiting response headers\n```\n\n- Timeout (wait for body)\n\n```bash\n./gourl https://httpbin.org/stream/10 -t 1s\n```\n\n```log\nINFO[0000] sending request into https://httpbin.org/stream/10\nINFO[0000] Method is: GET\nINFO[0000] Response status: 200 OK\nINFO[0000] headers are:\nINFO[0000] Date = [Tue, 30 Mar 2021 16:16:20 GMT]\nINFO[0000] Content-Type = [application/json]\nINFO[0000] Server = [gunicorn/19.9.0]\nINFO[0000] Access-Control-Allow-Origin = [*]\nINFO[0000] Access-Control-Allow-Credentials = [true]\n{\"url\": \"https://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-60634ed4-18bb3d5174fc841b7883a7f1\", \"Accept-Encoding\": \"gzip\", \"User-Agent\": \"Go-http-client/2.0\"}, \"origin\": \"94.139.160.188\", \"id\": 0}\n{\"url\": \"https://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-60634ed4-18bb3d5174fc841b7883a7f1\", \"Accept-Encoding\": \"gzip\", \"User-Agent\": \"Go-http-client/2.0\"}, \"origin\": \"94.139.160.188\", \"id\": 1}\n{\"url\": \"https://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-60634ed4-18bb3d5174fc841b7883a7f1\", \"Accept-Encoding\": \"gzip\", \"User-Agent\": \"Go-http-client/2.0\"}, \"origin\": \"94.139.160.188\", \"id\": 2}\n{\"url\": \"https://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-60634ed4-18bb3d5174fc841b7883a7f1\", \"Accept-Encoding\": \"gzip\", \"User-Agent\": \"Go-http-client/2.0\"}, \"origin\": \"94.139.160.188\", \"id\": 3}\n{\"url\": \"https://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-60634ed4-18bb3d5174fc841b7883a7f1\", \"Accept-Encoding\": \"gzip\", \"User-Agent\": \"Go-http-client/2.0\"}, \"origin\": \"94.139.160.188\", \"id\": 4}\n{\"url\": \"https://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-60634ed4-18bb3d5174fc841b7883a7f1\", \"Accept-Encoding\": \"gzip\", \"User-Agent\": \"Go-http-client/2.0\"}, \"origin\": \"94.139.160.188\", \"id\": 5}\n{\"url\": \"https://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-60634ed4-18bb3d5174fc841b7883a7f1\", \"Accept-Encoding\": \"gzip\", \"User-Agent\": \"Go-http-client/2.0\"}, \"origin\": \"94.139.160.188\", \"id\": 6}\n{\"url\": \"https://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-60634ed4-18bb3d5174fc841b7883a7f1\", \"Accept-Encoding\": \"gzip\", \"User-Agent\": \"Go-http-client/2.0\"}, \"origin\": \"94.139.160.188\", \"id\": 7}\n{\"url\": \"https://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-60634ed4-18bb3d5174fc841b7883a7f1\", \"Accept-Encoding\": \"gzip\", \"User-Agent\": \"Go-http-client/2.0\"}, \"origin\": \"94.139.160.188\", \"id\": 8}\n{\"url\": \"https://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-60634ed4-18bb3d5174fc841b7883a7f1\", \"Accept-Encoding\": \"gzip\", \"User-Agent\": \"Go-http-client/2.0\"}, \"origin\": \"94.139.160.188\", \"id\": 9}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1995parham-learning%2FgoURL","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1995parham-learning%2FgoURL","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1995parham-learning%2FgoURL/lists"}