Slide 48
Slide 48 text
// RecipeService.java
public Observable> get(…) {
...
return request(GET, “/recipes/:id”)
.noCache()
.noStore()
.to(RECIPE);
}
// ApiClient.java
if (isConnected) {
headers.put(CACHE_CONTROL, “only-if-cached");
} else if (noCache && noStore) {
headers.put(CACHE_CONTROL, "no-cache, no-store");
} else if (noCache) {
headers.put(CACHE_CONTROL, "no-cache");
} else if (noStore) {
headers.put(CACHE_CONTROL, "no-store");
}
HttpRequestCreator
RecipeService
ApiClient