send retrofit get request with no key for value

Viewed 249

I'm trying to make simple get request using retrofit which work on this URL example.com/product_barcode/12345678997455 but when I use it like this way

public interface Api {
    @GET(PRODUCT_BARCODE)
    public Single<Data> getProductData(@QueryName String barcode);

}

I got 404 error because the link be like that example.com/product_barcode/?12345678997455

how I use retrofit to get the request path without sign ? before barcode

1 Answers

Do it like this

@GET("example.com/product_barcode/{barcode}")
Single<Data> getProductData(@Path("barcode") String barcode);
Related