{"id":1617,"url":"https://github.com/netguru/ResponseDetective","last_synced_at":"2025-08-06T14:31:23.561Z","repository":{"id":33091429,"uuid":"36728893","full_name":"netguru/ResponseDetective","owner":"netguru","description":"Sherlock Holmes of the networking layer. :male_detective:","archived":false,"fork":false,"pushed_at":"2023-10-24T16:37:13.000Z","size":448,"stargazers_count":1954,"open_issues_count":10,"forks_count":92,"subscribers_count":41,"default_branch":"develop","last_synced_at":"2024-12-06T11:07:56.215Z","etag":null,"topics":["debugging","ios","macos","swift","tvos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"commaai/openpilot","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netguru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-06-02T11:36:01.000Z","updated_at":"2024-10-12T12:29:30.000Z","dependencies_parsed_at":"2023-11-23T22:44:03.846Z","dependency_job_id":null,"html_url":"https://github.com/netguru/ResponseDetective","commit_stats":{"total_commits":358,"total_committers":9,"mean_commits":39.77777777777778,"dds":"0.15642458100558654","last_synced_commit":"55ec742268b86da5e293fa55eecb545e186303b1"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FResponseDetective","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FResponseDetective/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FResponseDetective/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FResponseDetective/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netguru","download_url":"https://codeload.github.com/netguru/ResponseDetective/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228905546,"owners_count":17989781,"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":["debugging","ios","macos","swift","tvos"],"created_at":"2024-01-05T20:15:51.496Z","updated_at":"2024-12-09T14:31:16.678Z","avatar_url":"https://github.com/netguru.png","language":"Swift","readme":"![](Images/Header.png)\n\n![](https://img.shields.io/badge/swift-5.3-orange.svg)\n![](https://img.shields.io/github/release/netguru/ResponseDetective.svg)\n![](https://img.shields.io/badge/carthage-compatible-green.svg)\n![](https://img.shields.io/badge/cocoapods-compatible-green.svg)\n![](https://img.shields.io/badge/spm-compatible-green.svg)\n![](https://img.shields.io/badge/license-MIT-blue.svg)\n\n**ResponseDetective** is a non-intrusive framework for intercepting any outgoing requests and incoming responses between your app and your server for debugging purposes.\n\n## Requirements\n\nResponseDetective is written in **Swift 5.3** and supports **iOS 9.0+**, **macOS 10.10+** and **tvOS 9.0+**.\n\n## Usage\n\nIncorporating ResponseDetective in your project is very simple – it all comes down to just two steps:\n\n### Step 1: Enable interception\n\nFor ResponseDetective to work, it needs to be added as a middleman between your `(NS)URLSession` and the Internet. You can do this by registering the provided `URLProtocol` class in your session's `(NS)URLSessionConfiguration.protocolClasses`, or use a shortcut method:\n\n```objc\n// Objective-C\n\nNSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];\n[RDTResponseDetective enableInConfiguration:configuration];\n```\n\n```swift\n// Swift\n\nlet configuration = URLSessionConfiguration.default\nResponseDetective.enable(inConfiguration: configuration)\n```\n\nThen, you should use that configuration with your `(NS)URLSession`:\n\n```objc\n// Objective-C\n\nNSURLSession *session = [[NSURLSession alloc] initWithConfiguration:configuration];\n```\n\n```swift\n// Swift\n\nlet session = URLSession(configuration: configuration)\n```\n\nOr, if you're using [AFNetworking](https://github.com/AFNetworking/AFNetworking)/[Alamofire](https://github.com/Alamofire/Alamofire) as your networking framework, integrating ResponseDetective comes down to just initializing your `AFURLSessionManager`/`Manager` with the above `(NS)URLSessionConfiguration`:\n\n```objc\n// Objective-C (AFNetworking)\n\nAFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];\n```\n\n```swift\n// Swift (Alamofire)\n\nlet manager = Alamofire.SessionManager(configuration: configuration)\n```\n\nAnd that's all!\n\n### Step 2: Profit\n\nNow it's time to perform the actual request:\n\n```objc\n// Objective-C\n\nNSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@\"http://httpbin.org/get\"]];\n[[session dataTaskWithRequest:request] resume];\n```\n\n```swift\n// Swift\n\nlet request = URLRequest(URL: URL(string: \"http://httpbin.org/get\")!)\nsession.dataTask(with: request).resume()\n```\n\nVoilà! 🎉 Check out your console output:\n\n```none\n\u003c0x000000000badf00d\u003e [REQUEST] GET https://httpbin.org/get\n ├─ Headers\n ├─ Body\n │ \u003cnone\u003e\n\n\u003c0x000000000badf00d\u003e [RESPONSE] 200 (NO ERROR) https://httpbin.org/get\n ├─ Headers\n │ Server: nginx\n │ Date: Thu, 01 Jan 1970 00:00:00 GMT\n │ Content-Type: application/json\n ├─ Body\n │ {\n │   \"args\" : {\n │   },\n │   \"headers\" : {\n │     \"User-Agent\" : \"ResponseDetective\\/1 CFNetwork\\/758.3.15 Darwin\\/15.4.0\",\n │     \"Accept-Encoding\" : \"gzip, deflate\",\n │     \"Host\" : \"httpbin.org\",\n │     \"Accept-Language\" : \"en-us\",\n │     \"Accept\" : \"*\\/*\"\n │   },\n │   \"url\" : \"https:\\/\\/httpbin.org\\/get\"\n │ }\n```\n\n## Installation\n\n### Carthage\n\nIf you're using [Carthage](https://github.com/Carthage/Carthage), add the following dependency to your `Cartfile`:\n\n```none\ngithub \"netguru/ResponseDetective\" ~\u003e {version}\n```\n\n### CocoaPods\n\nIf you're using [CocoaPods](http://cocoapods.org), add the following dependency to your `Podfile`:\n\n```none\nuse_frameworks!\npod 'ResponseDetective', '~\u003e {version}'\n```\n\n### Swift Package Manager\n\nIf you're using [Swift Package Manager](https://github.com/apple/swift-package-manager), add this repository to the Swift Packages in your project settings.\n\n### Local\n\nTo install the test dependencies or to build ResponseDetective itself, do not run `carthage` directly. It can't handle the Apple Silicon architectures introduced in Xcode 12. Instead, run it through the `carthage.sh` script:\n\n```bash\n$ ./carthage.sh bootstrap\n```\n\nAlternatively, you can run the tests locally using Swift Package Manager with the following command:\n\n```bash\n$ swift test\n```\n\n## About\n\nThis project was made with ♡ by [Netguru](https://netguru.com).\n\n### Release names\n\nStarting from version 1.0.0, ResponseDetective's releases are named after [Sherlock Holmes canon stories](http://www.sherlockian.net/investigating/canon/), in chronological order. **What happens if we reach 60 releases and there are no more stories?** We don't know, maybe we'll start naming them after cats or something.\n\n### License\n\nThis project is licensed under **MIT License**. See [LICENSE.md](LICENSE.md) for more info.\n","funding_links":[],"categories":["Networking","Libs","Swift","HarmonyOS","Network [🔝](#readme)"],"sub_categories":["Video","Network","Other free courses","Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetguru%2FResponseDetective","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetguru%2FResponseDetective","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetguru%2FResponseDetective/lists"}