<commit_before>## Play + Retrofit

Retrofit is an amazing HTTP client scaffolding library. 
For more information about Retrofit checkout, [Square Retrofit](https://github.com/square/retrofit).

### Goal

The aim of this project is to make it more convenient to use Retrofit with the [Play Framework](https://www.playframework.com).

Retrofit supports the notion of non-blocking HTTP requests through `retrofit.Callback<T>`. The goal of this project is to make it really easy
to expose a `scala` wrapper that returns a `scala.concurrent.Future[T]` while also using Play Framework's `WS` library.

### Details

Let's say, we have the Retrofit HTTP interface defined:

```java
public interface GitHub {
  static class Contributor {
    String login;
    int contributions;
  }
  @GET("/repos/{owner}/{repo}/contributors")
  void contributors(@Path("owner") String owner, @Path("repo") String repo, Callback<List<Contributor>> callback);
}
```

You can now expose a more convenient scala interface that looks like:

```scala
class GitHubWrapper(github: GitHub)(implicit context: ExecutionContext) {
  def contributors(owner: String, repo: String): Future[util.List[Contributor]] = {
    val callback = new WSCallback[util.List[Contributor]]()
    github.contributors(owner, repo, callback)
    callback.future map {
      case WSResult(result: util.List[Contributor], retrofitResponse: Response) => result
    }
  }
}
```

For more details check-out the example `com.rahulrav.example` packages in for both the Java and Scala examples.<commit_msg>More minor changes to Readme<commit_after>## Play + Retrofit

Retrofit is an amazing HTTP client scaffolding library. 
For more information about Retrofit checkout, [Square Retrofit](https://github.com/square/retrofit).

### Goal

The aim of this project is to make it more convenient to use Retrofit with the [Play Framework](https://www.playframework.com).

Retrofit supports the notion of non-blocking HTTP requests through `retrofit.Callback<T>`. The goal of this project is to make it really easy
to expose a `scala` wrapper that returns a `scala.concurrent.Future[T]` while also using Play Framework's `WS` library.

### Details

Let's say, we have the Retrofit HTTP interface defined:

```java
public interface GitHub {
  static class Contributor {
    String login;
    int contributions;
  }
  @GET("/repos/{owner}/{repo}/contributors")
  void contributors(@Path("owner") String owner, @Path("repo") String repo, Callback<List<Contributor>> callback);
}
```

You can now expose a more convenient scala interface that looks like:

```scala
class GitHubWrapper(github: GitHub)(implicit context: ExecutionContext) {
  def contributors(owner: String, repo: String): Future[util.List[Contributor]] = {
    val callback = new WSCallback[util.List[Contributor]]()
    github.contributors(owner, repo, callback)
    callback.future map {
      case WSResult(result: util.List[Contributor], retrofitResponse: Response) => result
    }
  }
}
```

For more details check-out the [java](https://github.com/tikurahul/retrofit-play-wsclient/blob/master/src/main/java/com/rahulrav/example/GitHubClient.java)
and [scala](https://github.com/tikurahul/retrofit-play-wsclient/blob/master/src/main/scala/com/rahulrav/example/GitHubAsync.scala) examples.
{'fraction_non_alphanumeric': 0.11084043848964677, 'fraction_numerical': 0.0, 'mean_word_length': 4.9296028880866425, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '1581871', 'n_tokens_mistral': 989, 'n_tokens_neox': 935, 'n_words': 318}