{"id":13612473,"url":"https://github.com/ntsd/jekyll-http-request","last_synced_at":"2025-04-06T02:35:00.257Z","repository":{"id":185515992,"uuid":"673554246","full_name":"ntsd/jekyll-http-request","owner":"ntsd","description":"Jekyll Liquid Filter for HTTP requests, helps get HTTP response data to the page content and cache","archived":false,"fork":false,"pushed_at":"2024-04-17T21:41:58.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T04:53:24.710Z","etag":null,"topics":["jekyll","jekyll-plugin","liquid","liquid-filters","ruby"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/jekyll-http-request","language":"Ruby","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/ntsd.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":"2023-08-01T22:42:09.000Z","updated_at":"2024-07-16T16:16:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"5d193cab-ea56-4c2b-9ed5-f33d3758611f","html_url":"https://github.com/ntsd/jekyll-http-request","commit_stats":null,"previous_names":["ntsd/jekyll-http-request"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntsd%2Fjekyll-http-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntsd%2Fjekyll-http-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntsd%2Fjekyll-http-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntsd%2Fjekyll-http-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ntsd","download_url":"https://codeload.github.com/ntsd/jekyll-http-request/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247426848,"owners_count":20937195,"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":["jekyll","jekyll-plugin","liquid","liquid-filters","ruby"],"created_at":"2024-08-01T20:00:30.471Z","updated_at":"2025-04-06T02:35:00.224Z","avatar_url":"https://github.com/ntsd.png","language":"Ruby","readme":"# Jekyll HTTP Request\n\n[![Gem Version](https://img.shields.io/gem/v/jekyll-http-request.svg)](https://rubygems.org/gems/jekyll-http-request)\n\nJekyll Liquid Filter for HTTP requests, helps get HTTP response data to the page content and cache.\n\n\u003e since many people using UTF-8 nowaday, so I have decide to force encoding the response body to UTF-8.\n\n## Installation\n\n1. Add `gem 'jekyll-http-request'` to your site's Gemfile.\n2. run `bundle`.\n3. Add the following to your site's `_config.yml`:\n\n```yaml\nplugins:\n  - jekyll-http-request\n```\n\nAlternatively using git repository for gem `gem \"jekyll-http-request\", :git =\u003e \"git://github.com/ntsd/jekyll-http-request.git\"`.\n\n## Usage\n\n```rb\n{{ \u003curl\u003e | http_request: \u003chttp_method\u003e, \u003cheaders\u003e, \u003cbody\u003e }}\n```\n\n- `url`: url of the request.\n- `http_method`: (optional) the HTTP method, only support GET and POST for now.\n- `headers`: (optional) headers will separate by pipe (|) and separated key-value by colon (:).\n- `body`: (optional) http request body.\n\n\\*\\* The liquid filter left side parameters, set to empty string if not provided.\n\nThe response will cache to [Jekyll::Cache](https://jekyllrb.com/tutorials/cache-api/) for the next time it call the same request. The cache will clear after the site init.\n\n## Examples\n\n### HTTP GET\n\n```rb\n{{ 'http://httpbin.org/anything' | http_request }}\n# or\n{{ 'http://httpbin.org/anything' | http_request: 'GET', '', '' }}\n```\n\n### HTTPS GET\n\nif the url starts with `https` will force request with ssl.\n\n```rb\n{{ 'https://httpbin.org/anything' | http_request }}\n```\n\n### HTTP POST\n\n```rb\n{{ 'http://httpbin.org/anything' | http_request: 'POST' }}\n```\n\n### With headers\n\nheaders will separate by pipe (|) and separated key-value by colon (:).\n\n```rb\n{{ 'http://httpbin.org/anything' | http_request: 'GET', 'key:value|key2:value2' }}\n# of\n{{ 'http://httpbin.org/anything' | http_request: 'GET', 'key:value|key2:value2', '' }}\n```\n\n### With body\n\n```rb\n{{ 'http://httpbin.org/anything' | http_request: 'POST', '', 'body' }}\n```\n\n### With JSON body\n\nuse `capture` to define `jsonBody` variable.\n\n```rb\n{% capture jsonBody %}{ \"foo\": \"bar\" }{% endcapture %}\n{{ 'http://httpbin.org/anything' | http_request: 'POST', '', jsonBody }}\n```\n\n### Fetch Markdown and Render\n\nexample fetch Github README.md then render by markdownify\n\n```rb\n{{ 'https://raw.githubusercontent.com/ntsd/jekyll-http-request/main/README.md' | http_request: 'GET', '', '' | markdownify }}\n```\n\n### Unit Testing\n\nTo run unit test use `rake` command.\n\n```rb\nrake\n```\n","funding_links":[],"categories":["Other"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntsd%2Fjekyll-http-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntsd%2Fjekyll-http-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntsd%2Fjekyll-http-request/lists"}