<commit_before># Swallow

Swallow simplifies interaction with HTTP web services by providing a concise API for encoding `NSURLRequest` objects and processing the resulting `NSURLResponse` object. Designed as a lightweight utility for communicating with web services, Swallow is not intended to be a fully-featured networking library. By default Swallow uses the shared `NSURLSession` instance to create data tasks but can be configured to work with any NSURLSession instance using a [protocol](#sessiondatataskdatasource).

## Usage

At the highest level a request for a resource could look like the following:

```
// fetch list of stores based on zip code value
WebService(baseURLString: "https://somehapi.herokuapp.com")
    .fetchStores(zipCode: "15217")
    .responseStores { (stores: [StoreModel]?) in
      // update UI with model data<commit_msg>add travis CI badge to readme<commit_after># Swallow

[![Build Status](https://travis-ci.org/TheHolyGrail/Swallow.svg)](https://travis-ci.org/TheHolyGrail/Swallow)

Swallow simplifies interaction with HTTP web services by providing a concise API for encoding `NSURLRequest` objects and processing the resulting `NSURLResponse` object. Designed as a lightweight utility for communicating with web services, Swallow is not intended to be a fully-featured networking library. By default Swallow uses the shared `NSURLSession` instance to create data tasks but can be configured to work with any NSURLSession instance using a [protocol](#sessiondatataskdatasource).

## Usage

At the highest level a request for a resource could look like the following:

```
// fetch list of stores based on zip code value
WebService(baseURLString: "https://somehapi.herokuapp.com")
    .fetchStores(zipCode: "15217")
    .responseStores { (stores: [StoreModel]?) in
      // update UI with model data
{'fraction_non_alphanumeric': 0.07193460490463215, 'fraction_numerical': 0.005449591280653951, 'mean_word_length': 5.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '1285337', 'n_tokens_mistral': 500, 'n_tokens_neox': 474, 'n_words': 218}