{"id":13690103,"url":"https://github.com/dig/onset-http-plugin","last_synced_at":"2025-07-22T09:33:17.587Z","repository":{"id":99159992,"uuid":"230684269","full_name":"dig/onset-http-plugin","owner":"dig","description":"HTTP Library written in C++ using cURL libraries for the game Onset.","archived":false,"fork":false,"pushed_at":"2019-12-29T16:51:48.000Z","size":37,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-14T20:38:58.407Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2019-12-29T00:34:48.000Z","updated_at":"2020-04-06T09:37:12.000Z","dependencies_parsed_at":"2023-06-04T08:00:31.159Z","dependency_job_id":null,"html_url":"https://github.com/dig/onset-http-plugin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dig/onset-http-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dig%2Fonset-http-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dig%2Fonset-http-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dig%2Fonset-http-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dig%2Fonset-http-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dig","download_url":"https://codeload.github.com/dig/onset-http-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dig%2Fonset-http-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266465341,"owners_count":23933114,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-02T16:00:43.719Z","updated_at":"2025-07-22T09:33:17.542Z","avatar_url":"https://github.com/dig.png","language":"C++","funding_links":[],"categories":["Packages and Plugins"],"sub_categories":["Libraries"],"readme":"# onset-http-plugin\nAuthors: Digital\n\n### Features\n* Sync.\n* GET, POST, PUT, HEAD, DELETE \u0026 PATCH requests.\n* No JVM this time! :)\n\nMore features such as Async and other HTTP request methods are coming soon.\n\n### Installation\n1. Download onset-http-plugin.dll (Windows) \u0026 onset-http-plugin.so (Linux) from Releases ([HERE](https://github.com/dig/onset-http-plugin/releases)) and place inside plugins folder.\n1. Enable \"onset-http-plugin\" as a plugin inside server_config.json.\n\n### Building the plugin (Interested in contributing)\n#### Windows\n1. Install vcpkg (c++ package manager), instructions [here](https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2019).\n1. Install cURL static libraries. `./vcpkg install curl:x64-windows-static`\n1. Integrate into VS Studio. `./vcpkg integrate install`\n1. Run cmake in root project directory. `cmake -DCMAKE_GENERATOR_PLATFORM=x64 . -DVCPKG_TARGET_TRIPLET=x64-windows-static`\n1. Open onset-http-plugin.sln in Visual Studio.\n1. Change to Release and click Rebuild under `Build \u003e Rebuild Solution`.\n1. DLL will be `src/Release/onset-http-plugin.dll`\n\n#### Linux\n1. Install Libcurl4 and Libcurl-openssl-dev. `sudo apt-get install libcurl4 libcurl4-openssl-dev -y`\n1. Run cmake in root project directory. `cmake .`\n1. Run make in root project directory. `make`\n1. Output will be `src/onset-http-plugin.so`\n\n### Example\n```lua\nhttp_set_user_agent(\"myCustomPlugin/1.0\")\n\n-- Synchronously send a get request to http://www.httpbin.org/get and print the body\nlocal _res = http_get(\"http://www.httpbin.org/get\", {\n  customHeader = \"123\",\n  authentication = \"bearer 123\",\n})\nprint (_res.body)\n\n-- Synchronously send a post request to http://www.httpbin.org/post and print the status code\nlocal _res = http_post(\"http://www.httpbin.org/post\", {\n  customHeader = \"123\",\n  authentication = \"bearer 123\",\n}, {\n  field = \"123\",\n  name = \"joseph\"\n})\nprint (_res.status)\n\n```\n\n### Functions\n#### http_get (Sync)\nSend a Get request.\n```lua\nhttp_get(url, headers)\nhttp_get(url, headers, params)\n```\n* **url** The URL to send the request to. Example: https://google.com\n* **headers** Table of headers to send. Example: { myHeader = \"hi\", anotherHeader = \"lol\", authentication = \"bearer 123\" }\n* **params** Parameters to add to the request. Example: { apiKey = \"123\" }\n\nReturns a table with body (string), status (int), headers (table) and elapsed (float). Nil if failed.\n```lua\n{\n  status = 200,\n  elapsed = 0.123,\n  body = \"content here\",\n  headers = {\n    [\"Host\"] = \"www.httpbin.org\" \n  }\n}\n```\n\n#### http_post (Sync)\nSend a Post request.\n```lua\nhttp_post(url, headers, body)\nhttp_post(url, headers, fields)\n```\n* **url** The URL to send the request to. Example: https://google.com\n* **headers** Table of headers to send. Example: { myHeader = \"hi\", anotherHeader = \"lol\", authentication = \"bearer 123\" }\n* **body** String body, could be JSON. Example: \"Hello, I am the body of the POST request.\"\n* **fields** Same as above but table is automatically parsed to JSON. Example: { key = \"123\", name = \"Joseph\" }\n\nReturns a table with body (string), status (int), headers (table) and elapsed (float). Nil if failed.\n```lua\n{\n  status = 200,\n  elapsed = 0.123,\n  body = \"content here\",\n  headers = {\n    [\"Host\"] = \"www.httpbin.org\" \n  }\n}\n```\n\n#### http_put (Sync)\nSend a Put request.\n```lua\nhttp_put(url, headers, body)\nhttp_put(url, headers, fields)\n```\n* **url** The URL to send the request to. Example: https://google.com\n* **headers** Table of headers to send. Example: { myHeader = \"hi\", anotherHeader = \"lol\", authentication = \"bearer 123\" }\n* **body** String body, could be JSON. Example: \"Hello, I am the body of the POST request.\"\n* **fields** Same as above but table is automatically parsed to JSON. Example: { key = \"123\", name = \"Joseph\" }\n\nReturns a table with body (string), status (int), headers (table) and elapsed (float). Nil if failed.\n```lua\n{\n  status = 200,\n  elapsed = 0.123,\n  body = \"content here\",\n  headers = {\n    [\"Host\"] = \"www.httpbin.org\" \n  }\n}\n```\n\n#### http_head (Sync)\nSend a Head request.\n```lua\nhttp_head(url, headers)\nhttp_head(url, headers, params)\n```\n* **url** The URL to send the request to. Example: https://google.com\n* **headers** Table of headers to send. Example: { myHeader = \"hi\", anotherHeader = \"lol\", authentication = \"bearer 123\" }\n* **params** Parameters to add to the request. Example: { apiKey = \"123\" }\n\nReturns a table with body (string), status (int), headers (table) and elapsed (float). Nil if failed.\n```lua\n{\n  status = 200,\n  elapsed = 0.123,\n  body = \"content here\",\n  headers = {\n    [\"Host\"] = \"www.httpbin.org\" \n  }\n}\n```\n\n#### http_delete (Sync)\nSend a Delete request.\n```lua\nhttp_delete(url, headers, body)\nhttp_delete(url, headers, fields)\n```\n* **url** The URL to send the request to. Example: https://google.com\n* **headers** Table of headers to send. Example: { myHeader = \"hi\", anotherHeader = \"lol\", authentication = \"bearer 123\" }\n* **body** String body, could be JSON. Example: \"Hello, I am the body of the POST request.\"\n* **fields** Same as above but table is automatically parsed to JSON. Example: { key = \"123\", name = \"Joseph\" }\n\nReturns a table with body (string), status (int), headers (table) and elapsed (float). Nil if failed.\n```lua\n{\n  status = 200,\n  elapsed = 0.123,\n  body = \"content here\",\n  headers = {\n    [\"Host\"] = \"www.httpbin.org\" \n  }\n}\n```\n\n#### http_patch (Sync)\nSend a Patch request.\n```lua\nhttp_patch(url, headers, body)\nhttp_patch(url, headers, fields)\n```\n* **url** The URL to send the request to. Example: https://google.com\n* **headers** Table of headers to send. Example: { myHeader = \"hi\", anotherHeader = \"lol\", authentication = \"bearer 123\" }\n* **body** String body, could be JSON. Example: \"Hello, I am the body of the POST request.\"\n* **fields** Same as above but table is automatically parsed to JSON. Example: { key = \"123\", name = \"Joseph\" }\n\nReturns a table with body (string), status (int), headers (table) and elapsed (float). Nil if failed.\n```lua\n{\n  status = 200,\n  elapsed = 0.123,\n  body = \"content here\",\n  headers = {\n    [\"Host\"] = \"www.httpbin.org\" \n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdig%2Fonset-http-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdig%2Fonset-http-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdig%2Fonset-http-plugin/lists"}