<commit_before># Bluebonnet

[![Circle CI](https://circleci.com/gh/yatatsu/Bluebonnet.svg?style=svg)](https://circleci.com/gh/yatatsu/Bluebonnet)
[![Version](https://img.shields.io/cocoapods/v/Bluebonnet.svg?style=flat)](http://cocoapods.org/pods/Bluebonnet)
[![License](https://img.shields.io/cocoapods/l/Bluebonnet.svg?style=flat)](http://cocoapods.org/pods/Bluebonnet)
[![Platform](https://img.shields.io/cocoapods/p/Bluebonnet.svg?style=flat)](http://cocoapods.org/pods/Bluebonnet)

Bluebonnet is a simple APIClient using [Alamofire](https://github.com/Alamofire/Alamofire) and [ReactKit/SwiftTask](https://github.com/ReactKit/SwiftTask).

## Feature

- typed response
- handle as SwiftTask
- Swift 1.2

## Usage

To run the example project, clone the repo, and run `pod install` from the Example directory first.

### Set up client

- First, create a API class inherited ``Bluebonnet``.
- Then, create a struct implemented ``BluebonnetRequest``.
- Define request in the struct. (e.g. ``method``, ``parameters``)

```swift
public class GitHubAPI: Bluebonnet {

    // baseURL for all api
    static let baseURL: NSURL = NSURL(string: "https://api.github.com")!

    /**<commit_msg>add carthage badge<commit_after># Bluebonnet

[![Circle CI](https://circleci.com/gh/yatatsu/Bluebonnet.svg?style=svg)](https://circleci.com/gh/yatatsu/Bluebonnet)
[![Version](https://img.shields.io/cocoapods/v/Bluebonnet.svg?style=flat)](http://cocoapods.org/pods/Bluebonnet)
[![License](https://img.shields.io/cocoapods/l/Bluebonnet.svg?style=flat)](http://cocoapods.org/pods/Bluebonnet)
[![Platform](https://img.shields.io/cocoapods/p/Bluebonnet.svg?style=flat)](http://cocoapods.org/pods/Bluebonnet)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

Bluebonnet is a simple APIClient using [Alamofire](https://github.com/Alamofire/Alamofire) and [ReactKit/SwiftTask](https://github.com/ReactKit/SwiftTask).

## Feature

- typed response
- handle as SwiftTask
- Swift 1.2

## Usage

To run the example project, clone the repo, and run `pod install` from the Example directory first.

### Set up client

- First, create a API class inherited ``Bluebonnet``.
- Then, create a struct implemented ``BluebonnetRequest``.
- Define request in the struct. (e.g. ``method``, ``parameters``)

```swift
public class GitHubAPI: Bluebonnet {

    // baseURL for all api
    static let baseURL: NSURL = NSURL(string: "https://api.github.com")!

    /**
{'fraction_non_alphanumeric': 0.16852589641434262, 'fraction_numerical': 0.0027888446215139444, 'mean_word_length': 4.992840095465394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 18, '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': '6085946', 'n_tokens_mistral': 936, 'n_tokens_neox': 885, 'n_words': 166}