{"id":23745038,"url":"https://github.com/kwangsing3/http_methods_golang","last_synced_at":"2025-11-04T03:03:56.533Z","repository":{"id":57619381,"uuid":"389098118","full_name":"kwangsing3/http_methods_golang","owner":"kwangsing3","description":"http_methods_golang is a tiny wrapper for implementing HTTP request methods with Golang, and designed for reuse in every projects which don't have to implement those METHODS, when a simple communication is in need.","archived":false,"fork":false,"pushed_at":"2022-02-04T16:58:30.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-31T12:52:53.129Z","etag":null,"topics":["golang","http","request","wrapper"],"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/kwangsing3.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":"2021-07-24T12:49:41.000Z","updated_at":"2022-02-04T09:15:15.000Z","dependencies_parsed_at":"2022-09-16T18:50:24.672Z","dependency_job_id":null,"html_url":"https://github.com/kwangsing3/http_methods_golang","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwangsing3%2Fhttp_methods_golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwangsing3%2Fhttp_methods_golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwangsing3%2Fhttp_methods_golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwangsing3%2Fhttp_methods_golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kwangsing3","download_url":"https://codeload.github.com/kwangsing3/http_methods_golang/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239898460,"owners_count":19715212,"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":["golang","http","request","wrapper"],"created_at":"2024-12-31T12:52:57.245Z","updated_at":"2025-11-04T03:03:56.503Z","avatar_url":"https://github.com/kwangsing3.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# http_method_golang\n\u0026emsp; **http_methods_golang** is a tiny wrapper for implementing HTTP request methods with Golang, and designed for reuse in every projects which don't have to implement those **METHODS**, when a simple communication is in need.\n\n# Methods\n\u0026emsp;HTTP Protocol defined serveal request methods for gaining data and contents using Network.\n| METHOD  |  STATUS |   \n| --------|---------|\n| GET     |√|\n| POST    |√|\n| HEAD    |--|\n| PUT     |√|\n| DELETE  |√|\n| CONNECT |--|\n| OPTIONS |--|\n| TRACE   |--|\n| PATCH   |--| \n\n| OPERATE |  STATUS |   \n| --------|---------|\n| READ  FILE   |√|\n| WRITE FILE   |√|\n\n# Install\n```sh\ngo get github.com/kwangsing3/http_methods_golang\n```\n\n\n\n# Usage\n\n* ## GET\n1. Would return HTML file if request target is website. \u003cbr/\u003e\n2. Would return bytes if request a data.\n``` go\n//GET: To get data from GET method, need to wait for respone\n//\u003curl\u003e: request address.\nfunc GET(url string) ([]byte, error)\n```\n* ## POST\n1. Mostly use for encrypt request or requested using ```\u003cform\u003e```.\n2. May using for change server status or special request (Depends on the design).\n``` go\n//POST: To get data from POST method, need to wait for respone\n//\u003curl\u003e: request address.\n//\u003cquery\u003e: The query you want to do, mostly are json, but still depends on the server you request.\nfunc POST(url string, query []byte) ([]byte, error) \n```\n\n* ## DELETE\n``` go\n//DELETE: http Delete method request\nfunc DELETE(url string) ([]byte, error) \n```\n* ## PUT\n``` go\n//PUT: http Delete method request\nfunc PUT(url string, content string) ([]byte, error) \n```\n# Example\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\tHMG \"github.com/kwangsing3/http_methods_golang\"\n)\n\nfunc main() {\n\n\t/***GET request***/\n\tdataGET, errG := HMG.GET(\"https://example.com\")\n\tif errG != nil {\n\t\tfmt.Println(errG.Error())\n\t} \n\n\tfmt.Println(string(dataGET))\n\t/*** POST request***/\n\tquery := struct {\n\t\tMsg string\n\t}{\n\t\tMsg: `New Message`, //query Struct depends on the server you request.\n\t}\n\tbytequery, _ := json.Marshal(query)\n\tdataPOST, errP := HMG.POST(\"https://example.com\", bytequery)\n\tif errP != nil {\n\t\tfmt.Println(errP.Error())\n\t} \n\n\tfmt.Println(string(dataPOST))\n    return\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwangsing3%2Fhttp_methods_golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwangsing3%2Fhttp_methods_golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwangsing3%2Fhttp_methods_golang/lists"}