Reputation: 8604
I am trying to call a legacy API using Retrofit 2, this is the URL "/api/0.3/v3/?endpoint=/admin/customers/6728382/addresses.json"
and this is the interface method
@GET("/api/0.3/v3/?endpoint=/admin/customers/{customerId}/addresses.json")
Single<GetCustomerAddressesResponse> getUserAddresses(@Path("customerId") String customerId);
However I am getting this error,
"URL query string "endpoint=//admin/customers/{customerId}/addresses.json" must not have replace block. For dynamic query parameters use @Query."
How can I fix this?
Upvotes: 3
Views: 4072
Reputation: 48602
"URL query string "endpoint=//admin/customers/{customerId}/addresses.json" must not have replace block. For dynamic query parameters use @Query."
As it suggests you should use @Query
instead of @Path
.
Single<GetCustomerAddressesResponse> getUserAddresses(@Query("customerId") String customerId);
You may like to read this in details about @Query
annotation https://square.github.io/retrofit/2.x/retrofit/index.html?retrofit2/http/Query.html
Upvotes: 0