An HTTP client example

Let's use RxJava to retrieve information about the GitHub repositories of a user by username. We will use our subscribePrint() function used previously to output the information to the system output. The idea of the program is to display all of the public repositories of the user that are not forks. The main part of the program looks like this:

String username = "meddle0x53";
Observable<Map> resp = githubUserInfoRequest(client, username);
subscribePrint(
  resp
  .map(json ->
    json.get("name") + "(" + json.get("language") + ")"),
  "Json"
);

This program uses my user (it can be easily reworked to use a username passed as a parameter) to retrieve information its public repositories. It prints the name of each repository and the main ...

Get Learning Reactive Programming with Java 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.