is there a method to add custom header to request when image is downloaded? I can use volley or okhttp in Glide.
I try add cookie to cookiemanager in okhttpclient, but i
Since 3.6.0 it's possible to set custom headers for each request:
GlideUrl glideUrl = new GlideUrl("url", new LazyHeaders.Builder()
.addHeader("key1", "value")
.addHeader("key2", new LazyHeaderFactory() {
@Override
public String buildHeader() {
String expensiveAuthHeader = computeExpensiveAuthHeader();
return expensiveAuthHeader;
}
})
.build());
Glide....load(glideUrl)....;