Last active
February 4, 2018 17:36
-
-
Save mohsenoid/0a28c32dce65b916ef5da8df178ea37e to your computer and use it in GitHub Desktop.
Sample Retrofit API interface https://hackernoon.com/yet-another-mvp-article-part-3-calling-apis-using-retrofit-23757f4eee05
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
package com.mirhoseini.marvel.domain.client; | |
import com.mirhoseini.marvel.domain.model.CharactersResponse; | |
import retrofit2.http.GET; | |
import retrofit2.http.Query; | |
import rx.Observable; | |
public interface MarvelApi { | |
String NAME = "name"; | |
String API_KEY = "apikey"; | |
String HASH = "hash"; | |
String TIMESTAMP = "ts"; | |
// http://gateway.marvel.com:80/v1/public/characters?name=Iron%20Man&apikey=PUBLIC_API_KEY&hash=HASH&ts=TIMESTAMP | |
@GET("v1/public/characters") | |
Observable<CharactersResponse> getCharacters( | |
@Query(NAME) String query, | |
@Query(API_KEY) String publicKey, | |
@Query(HASH) String hash, | |
@Query(TIMESTAMP) long timestamp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment