Skip to content

Instantly share code, notes, and snippets.

@snijsure
Created July 18, 2018 18:45
Show Gist options
  • Save snijsure/6abed708488daf7f17f58a1e182a680f to your computer and use it in GitHub Desktop.
Save snijsure/6abed708488daf7f17f58a1e182a680f to your computer and use it in GitHub Desktop.
Sample Api Service
import com.yourpackage.model.Price
import com.yourpackage.model.Ticket
import io.reactivex.Single
import retrofit2.http.GET
import retrofit2.http.Query
interface ApiService {
@GET("airline/tickets")
fun searchTickets(@Query("from") from: String, @Query("to") to: String): Single<List<Ticket>>
@GET("airline/price")
fun getPrice(@Query("flight_number") flightNumber: String, @Query("from") from: String, @Query("to") to: String): Single<Price>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment