I use volley imagerequest to override getheader() to put cookie into request before,like this:
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap map = new HashMap();
map.put("Cookie", "AppName=myappname;UserName=" + username);
return map;
}
now I transfer to glide ,how do I use glide to get ?
you can use GlideUrl. like this.
LazyHeaders.Builder builder = new LazyHeaders.Builder()
.addHeader("User-Agent", "your UA string")
.addHeader("Authorization", "your basic authentication string.")
.addHeader("Cookie", "your cookie string");
GlideUrl glideUrl = new GlideUrl(url, builder.build());
Glide.with(context).load(glideUrl).into(imageView);
Yes, that's the simplest way.
You can find more info in #921 if you want to centralize authentication.
Most helpful comment
you can use GlideUrl. like this.