<commit_before># Fuel

The easiest HTTP networking library in Kotlin for Android.

[ ![Download](https://api.bintray.com/packages/kittinunf/maven/Fuel/images/download.svg) ](https://bintray.com/kittinunf/maven/Fuel/_latestVersion)

## Features

- [x] Support basic HTTP GET/POST/PUT/DELETE in a fluent style interface
- [x] Download File
- [ ] Upload File
- [x] Configuration manager

## Installation

### Gradle

``` Groovy
dependencies {
    compile 'fuel:fuel:0.1'
}
```

### Sample

* There are two sample folders, one is in Kotlin and another one in Java.

## Usage

### GET

``` Kotlin
Fuel.get("http://httpbin.org/get").response { request, response, either ->
    println(request)
    println(response)
    val (error, bytes) = either
    if (bytes != null) {
        println(bytes)
    }
}
```<commit_msg>update readme to include java usage<commit_after># Fuel

The easiest HTTP networking library in Kotlin for Android.

[ ![Download](https://api.bintray.com/packages/kittinunf/maven/Fuel/images/download.svg) ](https://bintray.com/kittinunf/maven/Fuel/_latestVersion)

## Features

- [x] Support basic HTTP GET/POST/PUT/DELETE in a fluent style interface
- [x] Download File
- [ ] Upload File
- [x] Configuration manager

## Installation

### Gradle

``` Groovy
dependencies {
    compile 'fuel:fuel:0.1'
}
```

### Sample

* There are two sample folders, one is in Kotlin and another one in Java.

* Kotlin

``` Kotlin
//simplest get
Fuel.get("/get").responseString { request, response, either ->
}
```

* Java

``` Java
//simplest get
Fuel.get("http://httpbin.org/get", params).responseString(new Handler<String>() {
    @Override
    public void handle(Request request, Response response, Either<FuelError, String> either) {
    }
});
```

## Usage

### GET

``` Kotlin
Fuel.get("http://httpbin.org/get").response { request, response, either ->
    println(request)
    println(response)
    val (error, bytes) = either
    if (bytes != null) {
        println(bytes)
    }
}
```
{'fraction_non_alphanumeric': 0.15060240963855423, 'fraction_numerical': 0.002008032128514056, 'mean_word_length': 3.7004716981132075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7261639', 'n_tokens_mistral': 691, 'n_tokens_neox': 647, 'n_words': 170}