I need to make a Get
request in retrofit and the parameter would be Strings
separated by space.
For example:
http://www.something.com?req=hello testing
When we hit the above URL in browser it will become like this:
http://www.something.com/?req=hello%20testing
How can I achieve with retrofit? I know the basic and able to call the Get
request from retrofit successfully but all of those contain one string or similar parameters.
@GET("/search?req={req}")
public Observable<List<Model>> getWarehouse (String req);
To call above request I wrote following code:
adapter.create(WarehouseAPI.class).getWarehouse()
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<List<Warehouse>>(){
..........
..........
What do I need to change for passing string with spaces in above code?