I'm attempting to add authentication headers while loading images using the Xamarin version of the Picasso library. I see other threads for how to do it using native Android (e.g. Android Picasso library, How to add authentication headers?), however I'm not seeing the same properties and methods available in Xamarin. Has anyone accomplished this?
OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Request newRequest = chain.request().newBuilder()
.addHeader("X-TOKEN", "VAL")
.build();
return chain.proceed(newRequest);
}
})
.build();
Picasso picasso = new Picasso.Builder(context)
.downloader(new OkHttp3Downloader(client))
.build();