{"id":13730420,"url":"https://github.com/adamski/RestRequest","last_synced_at":"2025-05-08T03:30:26.864Z","repository":{"id":55010566,"uuid":"48261412","full_name":"adamski/RestRequest","owner":"adamski","description":"JUCE module for making HTTP requests to REST API's","archived":false,"fork":false,"pushed_at":"2021-01-15T14:10:57.000Z","size":11,"stargazers_count":63,"open_issues_count":5,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-14T21:38:01.294Z","etag":null,"topics":["http-requests","juce","rest-api","restrequest"],"latest_commit_sha":null,"homepage":null,"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/adamski.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":"2015-12-18T23:41:13.000Z","updated_at":"2024-05-26T22:29:15.000Z","dependencies_parsed_at":"2022-08-14T09:00:46.237Z","dependency_job_id":null,"html_url":"https://github.com/adamski/RestRequest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamski%2FRestRequest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamski%2FRestRequest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamski%2FRestRequest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamski%2FRestRequest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamski","download_url":"https://codeload.github.com/adamski/RestRequest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252992661,"owners_count":21837164,"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":["http-requests","juce","rest-api","restrequest"],"created_at":"2024-08-03T02:01:14.579Z","updated_at":"2025-05-08T03:30:26.607Z","avatar_url":"https://github.com/adamski.png","language":"C++","readme":"# RestRequest\nJUCE module for making HTTP requests to REST API's\n\n### Example Usage\n\nFirst declare your class instance e.g. as a member variable:\n```cpp\nadamski::RestRequest request;\n```\n\nThen in your constructor add any headers you will need across different requests e.g.:\n```cpp\nrequest.header (\"Content-Type\", \"application/json\");\nrequest.header (\"Authorization\", \"Basic \" + Base64::toBase64 (\"username:password\"));\n```\n\nExample `GET` request:\n\n```cpp\nadamski::RestRequest::Response response = request.get (\"registry/_design/module-views/_view/all-modules\")\n        .execute();\n\n// Example response debugging\n\nDBG (response.bodyAsString);\nDBG (response.result.getErrorMessage());\n        \nfor (auto key : response.headers.getAllKeys())\n{\n        DBG (key \u003c\u003c \": \" \u003c\u003c response.headers.getValue(key, \"n/a\"));\n}\n```\n\nExample `POST` request:\n\n```cpp\nadamski::RestRequest::Response response = request.post (\"registry/_find\")\n        .field (\"selector\", searchString)\n        .execute();\n```\n\nExample `PUT` request with chained field methods:\n\n```cpp\nadamski::RestRequest::Response response = request.put (\"_users/\" + id)\n        .field (\"type\", \"user\")\n        .field (\"name\", username)\n        .field (\"email\", email)\n        .field (\"roles\", Array\u003cvar\u003e({var(\"publisher\")}))\n        .field (\"password_sha\", stringToSHA1 (password + salt))\n        .field (\"salt\", salt)\n        .execute();\n\n```\n\nIf you need to encode or decode strings with SHA1 I made a JUCE module out of an open source library called smallsha1: https://github.com/adamski/smallsha1\n","funding_links":[],"categories":["Networking \u0026 Cryptography"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamski%2FRestRequest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamski%2FRestRequest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamski%2FRestRequest/lists"}