In my Android app I have to call a web service which looks like this
http://mywesite.com/demo/mob/getmenubycategory/1
I am using the volle
just override this method
@Override
public Map getHeaders() {
String username ="danish@gmail.com";
String password = "dani3173";
String auth =new String(username + ":" + password);
byte[] data = auth.getBytes();
String base64 = Base64.encodeToString(data, Base64.NO_WRAP);
HashMap headers = new HashMap();
headers.put("Authorization",base64);
headers.put("accept-language","EN");
headers.put("Content-type","application/json");
headers.put("Accept","application/json");
return headers;
}