Created
January 15, 2017 08:34
-
-
Save travisdachi/fd83324ae7303e6ee5991a1d7f8a39ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Apis { | |
public static StarWarsApi getSwarWarsApi() { | |
Gson gson = new GsonBuilder() | |
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) | |
.create(); | |
Retrofit retrofit = new Retrofit.Builder() | |
.baseUrl("http://swapi.co/api/") | |
.addConverterFactory(GsonConverterFactory.create(gson)) | |
.build(); | |
return retrofit.create(StarWarsApi.class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment