{"id":13463453,"url":"https://github.com/maccman/nestful","last_synced_at":"2025-12-24T09:47:52.099Z","repository":{"id":675199,"uuid":"617575","full_name":"maccman/nestful","owner":"maccman","description":"Simple Ruby HTTP/REST client with a sane API","archived":false,"fork":false,"pushed_at":"2021-08-30T08:00:16.000Z","size":122,"stargazers_count":505,"open_issues_count":11,"forks_count":33,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-25T02:41:53.757Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/maccman.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-04-19T10:51:37.000Z","updated_at":"2025-01-24T00:03:02.000Z","dependencies_parsed_at":"2022-07-15T03:00:41.380Z","dependency_job_id":null,"html_url":"https://github.com/maccman/nestful","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maccman%2Fnestful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maccman%2Fnestful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maccman%2Fnestful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maccman%2Fnestful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maccman","download_url":"https://codeload.github.com/maccman/nestful/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245414392,"owners_count":20611359,"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":[],"created_at":"2024-07-31T13:00:53.755Z","updated_at":"2025-12-24T09:47:52.091Z","avatar_url":"https://github.com/maccman.png","language":"Ruby","funding_links":[],"categories":["API Client Development Tools","Web Apps, Services \u0026 Interaction","Ruby","HTTP"],"sub_categories":["Ruby","HTTP clients"],"readme":"Nestful is a simple Ruby HTTP/REST client with a sane API.\n\n## Installation\n\n    sudo gem install nestful\n\n## Features\n\n  * Simple API\n  * JSON requests\n  * Resource API\n  * Proxy support\n  * SSL support\n\n## API\n\n### GET request\n\n    Nestful.get 'http://example.com' #=\u003e \"body\"\n\n### POST request\n\n    # url-encoded form POST\n    Nestful.post 'http://example.com', :foo =\u003e 'bar'\n\n    # JSON POST\n    Nestful.post 'http://example.com', {:foo =\u003e 'bar'}, :format =\u003e :json\n\n### Parameters\n\n    # You can also provide nestled params\n    Nestful.get 'http://example.com', :nestled =\u003e {:vars =\u003e 1}\n\n## Request\n\n`Request` is the base class for making HTTP requests - everthing else is just an abstraction upon it.\n\n    Nestful::Request.new(url, options).execute #=\u003e \u003cNestful::Response\u003e\n\nValid `Request` options are:\n\n  * headers (hash)\n  * params  (hash)\n  * method  (:get/:post/:put/:delete/:head)\n  * proxy\n  * user\n  * password\n  * auth_type (:basic/:bearer)\n  * timeout\n  * ssl_options\n\nRequests are run via the `execute` method.\n\n## Endpoint\n\nThe `Endpoint` class provides a single object to work with restful services. The following example does a GET request to the URL; http://example.com/assets/1/\n\n    Nestful::Endpoint.new('http://example.com')['assets'][1].get #=\u003e Nestful::Response\n\n## Resource\n\nIf you're building a binding for a REST API, then you should consider using the `Resource` class.\n\n    class Charge \u003c Nestful::Resource\n      endpoint 'https://api.stripe.com/v1/charges'\n      options :auth_type =\u003e :bearer, :password =\u003e 'sk_bar'\n\n      def self.all\n        self.new(get)\n      end\n\n      def self.find(id)\n        self.new(get(id))\n      end\n\n      def refund\n        post(:refund)\n      end\n    end\n\n    Charge.all #=\u003e []\n    Charge.find('ch_bar').amount\n\n## Response\n\nAll HTTP responses are in the form of a `Nestful::Response` instance. This contains the raw HTTP response, body, headers and a few helper methods:\n\n    response = Nestful.get('http://www.google.com')\n    response.body #=\u003e '\u003chtml\u003e...'\n    response.headers #=\u003e {'Content-Type' =\u003e 'text/html'}\n    response.status #=\u003e 200\n\nYou can also access the decoded body if available, such as for JSON responses:\n\n    response = Nestful.get('http://api.stripe.com/v1/charges')\n    charges  = response.decoded\n\nAll calls are proxied to the decoded body, so you can access JSON properties like this:\n\n    charges = Nestful.get('http://api.stripe.com/v1/charges')['data']\n\n## Credits\n\nParts of the connection code were inspired from ActiveResource.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaccman%2Fnestful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaccman%2Fnestful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaccman%2Fnestful/lists"}