{"id":20171608,"url":"https://github.com/pascalw/pwfakeweb","last_synced_at":"2025-08-21T12:13:40.659Z","repository":{"id":139405565,"uuid":"2494730","full_name":"pascalw/PWFakeWeb","owner":"pascalw","description":"Stub out HTTP requests for testing HTTP related Objective-C code.","archived":false,"fork":false,"pushed_at":"2011-12-19T20:46:42.000Z","size":108,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T04:27:12.941Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/pascalw.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":"2011-10-01T12:31:22.000Z","updated_at":"2013-12-07T19:41:45.000Z","dependencies_parsed_at":"2023-03-13T10:48:58.124Z","dependency_job_id":null,"html_url":"https://github.com/pascalw/PWFakeWeb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pascalw/PWFakeWeb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalw%2FPWFakeWeb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalw%2FPWFakeWeb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalw%2FPWFakeWeb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalw%2FPWFakeWeb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pascalw","download_url":"https://codeload.github.com/pascalw/PWFakeWeb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalw%2FPWFakeWeb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260245076,"owners_count":22980141,"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-11-14T01:25:47.718Z","updated_at":"2025-06-16T21:33:43.992Z","avatar_url":"https://github.com/pascalw.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PWFakeWeb\n\nPWFakeWeb is inspired by the ruby [fakeweb gem](http://fakeweb.rubyforge.org/). It allows you to stub out HTTP calls, for example through [ASIHTTPRequest](http://allseeing-i.com/ASIHTTPRequest/). Ideal for testing HTTP related code.\n\nPWFakeWeb comes with a fakeweb implementation for ASIHTTPRequest. PWFakeWeb however is only loosely coupled to ASIHTTPRequest, allowing you to use PWFakeWeb to override calls in any HTTP library. For an example how to do this, checkout the `ASIHTTPRequest+fakeweb.m` source code.\n\n## Getting started\n\nTo get started link the PWFakeWeb static library into your testing target (for a walkthrough, see [here](http://stackoverflow.com/questions/6124523/linking-a-static-library-to-an-ios-project-in-xcode-4/6124872#6124872)).\n\nNow all you need to do is `#import ASIHTTPRequest+fakeweb.m` into your test and off you go!\n\n## Examples\n\nRegistring fakes:\n\n\t[PWFakeWeb registerURI: @\"http://pwiddershoven.nl\" method: @\"GET\" body: @\"Hello, world!\"];\n\n\tNSURL *url = [NSURL URLWithString: @\"http://pwiddershoven.nl\"];\n\n\tASIHTTPRequest *request =  [ASIHTTPRequest requestWithURL: url];\n\t[request startSynchronous];\n\n\t[request responseString]; =\u003e @\"Hello, world!\"\n\nYou can also match URIs with regular expressions, like so:\n\n\t[PWFakeWeb registerURI: @\"http://google\\.(com|nl|co\\.uk)/(.*)\" method: @\"GET\" body: @\"Hello, world!\"];\n\nAnd set status codes:\n\n  [PWFakeWeb registerURI: @\"http://google.com\" method: @\"POST\" body: @\"\" status: 500];\n\n\t\nSee the specs in `src/PWFakeWebSpecs/PWFakeWebSpec.m` for a full usage example.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalw%2Fpwfakeweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpascalw%2Fpwfakeweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalw%2Fpwfakeweb/lists"}