Skip to content

Commit

Permalink
modified retrofit GET request to be more compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
jairrab committed Oct 7, 2019
1 parent 67e1269 commit 8594813
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import com.jairrab.remote.api.Constants.MAPBOX_API
import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

interface RetrofitMapbox {

@GET("mapbox.places/{longitude}%2C%20{latitude}.json?access_token=$MAPBOX_API")
@GET("mapbox.places/{longitude}%2C%20{latitude}.json")
fun getLocationQuery(
@Path("latitude") latitude: Double,
@Path("longitude") longitude: Double
@Path("longitude") longitude: Double,
@Query("access_token") query: String = MAPBOX_API
): Observable<LocationQuery>
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ object RetrofitServiceFactory {
val retrofit = Retrofit.Builder()
.baseUrl("https://api.mapbox.com/geocoding/v5/")
.client(okHttpClient)

.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create(gson))
.build()
Expand Down

0 comments on commit 8594813

Please sign in to comment.