When I Type Base Url="https://www.bkashcluster.com:9081/dreamwave/merchant/trxcheck/sendmsg/" with last slash(/) then give me message like this:
Response{protocol=http/1.1, code=500, message=Internal Server Error, url=https://www.bkashcluster.com:9081/dreamwave/merchant/trxcheck/sendmsg/?user=XX&pass=r@12&msisdn=0160000000&trxid=6BM3KRWHLB}
After "sendmsg" slash(/) does not need
And When I Type Base Url="https://www.bkashcluster.com:9081/dreamwave/merchant/trxcheck/sendmsg" with out last slash(/) then apps unfortunately stop;
For this I Want to remove last "/" any way from Base Url.
private void requestDataForBkashTransaction() {
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://www.bkashcluster.com:9081/dreamwave/merchant/trxcheck/sendmsg/")
.addConverterFactory(GsonConverterFactory.create())
.build();
InstituteService api = retrofit.create(InstituteService.class);
String urlString=String.format("?user=Exampll&pass=12345&msisdn=0160000000&trxid=6BM3KRWHLB");
Call<List<Transaction>> call=api.getBkashTrasactionCode(urlString);
call.enqueue(new retrofit2.Callback<List<Transaction>>() {
@Override
public void onResponse(Call<List<Transaction>> call, retrofit2.Response<List<Transaction>> response) {
if(!response.isSuccessful()){
Toast.makeText(PaymentActivity.this, response.code(), Toast.LENGTH_LONG).show();
return;
}
List<Transaction> transactions=response.body();
for(Transaction transaction:transactions){
String content="";
content+=transaction.getTrxId();
textView.append(content);
}
}
@Override
public void onFailure(Call<List<Transaction>> call, Throwable t) {
}
});
}
@GET
Call<List<Transaction>> getBkashTrasactionCode(@Url String url);