<commit_before># ResponseDetective

![](https://img.shields.io/circleci/project/netguru/ResponseDetective.svg)
![](https://img.shields.io/badge/swift-1.2-orange.svg)
![](https://img.shields.io/github/release/netguru/ResponseDetective.svg)
![](https://img.shields.io/badge/carthage-compatible-brightgreen.svg)
![](https://img.shields.io/badge/cocoapods-compatible-brightgreen.svg)

**ResponseDetective** is a non-intrusive framework for intercepting any outgoing requests and incoming responses between your app and your server for debugging purposes.

## Usage

Incorporating ResponseDetective in your project is very simple – it all comes down to a couple of steps.

### Step 1: Register interceptors

You may register as many request, response and error interceptors as you like.

```swift
// request
InterceptingProtocol.registerRequestInterceptor(BaseInterceptor())
InterceptingProtocol.registerRequestInterceptor(JSONInterceptor())

// response
InterceptingProtocol.registerResponseInterceptor(BaseInterceptor())
InterceptingProtocol.registerResponseInterceptor(JSONInterceptor())
InterceptingProtocol.registerResponseInterceptor(HTMLInterceptor())
<commit_msg>Add requirements info<commit_after># ResponseDetective

![](https://img.shields.io/circleci/project/netguru/ResponseDetective.svg)
![](https://img.shields.io/badge/swift-1.2-orange.svg)
![](https://img.shields.io/github/release/netguru/ResponseDetective.svg)
![](https://img.shields.io/badge/carthage-compatible-brightgreen.svg)
![](https://img.shields.io/badge/cocoapods-compatible-brightgreen.svg)

**ResponseDetective** is a non-intrusive framework for intercepting any outgoing requests and incoming responses between your app and your server for debugging purposes.

## Requirements

ResponseDetective requires **iOS 8** or **OS X 10.10**.

## Usage

Incorporating ResponseDetective in your project is very simple – it all comes down to a couple of steps.

### Step 1: Register interceptors

You may register as many request, response and error interceptors as you like.

```swift
// request
InterceptingProtocol.registerRequestInterceptor(BaseInterceptor())
InterceptingProtocol.registerRequestInterceptor(JSONInterceptor())

// response
InterceptingProtocol.registerResponseInterceptor(BaseInterceptor())
InterceptingProtocol.registerResponseInterceptor(JSONInterceptor())
InterceptingProtocol.registerResponseInterceptor(HTMLInterceptor())

{'fraction_non_alphanumeric': 0.11101905550952776, 'fraction_numerical': 0.004556752278376139, 'mean_word_length': 6.918032786885246, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7260644', 'n_tokens_mistral': 733, 'n_tokens_neox': 657, 'n_words': 157}