{"id":22065981,"url":"https://github.com/iij/mruby-webapi","last_synced_at":"2025-09-15T08:13:51.832Z","repository":{"id":20104739,"uuid":"23374337","full_name":"iij/mruby-webapi","owner":"iij","description":"WebAPI client for mruby","archived":false,"fork":false,"pushed_at":"2017-04-03T07:51:01.000Z","size":15,"stargazers_count":4,"open_issues_count":2,"forks_count":5,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-13T01:53:33.832Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iij.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-27T02:33:56.000Z","updated_at":"2018-04-09T19:42:19.000Z","dependencies_parsed_at":"2022-08-05T07:02:45.694Z","dependency_job_id":null,"html_url":"https://github.com/iij/mruby-webapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iij/mruby-webapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iij%2Fmruby-webapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iij%2Fmruby-webapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iij%2Fmruby-webapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iij%2Fmruby-webapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iij","download_url":"https://codeload.github.com/iij/mruby-webapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iij%2Fmruby-webapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275225930,"owners_count":25427015,"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-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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-11-30T19:22:57.694Z","updated_at":"2025-09-15T08:13:51.800Z","avatar_url":"https://github.com/iij.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mruby-webapi\n\n\"mruby-webapi\" is a WebAPI client library.\n\n\n## API\n\n - WebAPI.new url, opts={}\n   - Make an WebAPI object to be used to call APIs whose base url is `url`\n   - Supported keys in `opts`:\n     - :accept_encoding =\u003e str (mruby-zlib is required)\n       - acceptable response encoding\n         (supported type: \"gzip\" or \"deflate\")\n     - :certs =\u003e str\n       - pathname of the file contains trusted root CA certificate(s)\n     - :content_encoding =\u003e str (mruby-zlib is required)\n       - type of request body encoding\n         (supported type: \"gzip\" or \"deflate\")\n     - :content_type =\u003e str\n       - \"Content-Type\" of the request body (if any)\n     - :headers =\u003e Hash\n       - arbitrary header fields.\n     - :ignore_certificate_validity =\u003e boolean\n       - ignore \"Not Before\" and \"Not After\" fields of certificates\n         (see https://github.com/iij/mruby-tls-openssl)\n     - :proxy =\u003e str\n       - URL of HTTPS proxy\n     - :sni =\u003e false (default) | true | String\n       - use Server Name Indication (SNI)\n         (see https://github.com/iij/mruby-tls-openssl)\n\n - WebAPI#get resource\n - WebAPI#post resource, data\n - WebAPI.urlencode pairs\n   - `pairs` can be Hash or Array (like `[[key1, value1], [key2, value2], ...]`)\n - WebAPI.urldecode str\n\n\n## Example\n\n```Ruby\napi = WebAPI.new \"https://api.github.com/\", {\n  :certs =\u003e \"digicert.crt\",\n  :content_type =\u003e \"application/json\",\n  :headers =\u003e {\n    \"X-AnyHeader\" =\u003e \"Some Text\"\n  }\n}\nmd = JSON.generate({\n  \"text\" =\u003e \"Hello world github/linguist#1 **cool**, and #1!\",\n  \"mode\" =\u003e \"gfm\",\n  \"context\" =\u003e \"github/gollum\"\n})\n# or md = '{\"text\":\"Hello world\"}'\nputs \"* Request Message (for debug):\"\nputs api.post_str \"/markdown\", md\n\nputs\nputs \"* API Response Body:\"\nresponse = api.post \"/markdown\", md\nhtml = response.body\nputs html\n```\n\n```\n* Request Message (for debug):\nPOST /markdown HTTP/1.1\nHost: api.github.com:443\nConnection: close\nUser-Agent: mruby-webapi\nContent-Type: application/json\nContent-Length: 97\nX-AnyHeader: Some Text\n\n{\"text\":\"Hello world github/linguist#1 **cool**, and #1!\",\"mode\":\"gfm\",\"context\":\"github/gollum\"}\n\n* API Response Body:\n\u003cp\u003eHello world github/linguist#1 \u003cstrong\u003ecool\u003c/strong\u003e, and #1!\u003c/p\u003e\n```\n\n## License\n\nCopyright (c) 2014 Internet Initiative Japan Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a \ncopy of this software and associated documentation files (the \"Software\"), \nto deal in the Software without restriction, including without limitation \nthe rights to use, copy, modify, merge, publish, distribute, sublicense, \nand/or sell copies of the Software, and to permit persons to whom the \nSoftware is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in \nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER \nDEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiij%2Fmruby-webapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiij%2Fmruby-webapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiij%2Fmruby-webapi/lists"}