Glide - adding header to request

前端 未结 8 1305
北海茫月
北海茫月 2021-02-02 09:25

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

8条回答
  •  南笙
    南笙 (楼主)
    2021-02-02 09:48

    Interceptors sound like a great choice. You can pass in your own instance of an OkHttp client to an OkHttpUrlLoader.Factory and register the Factory with Glide.

    If you want more control, you can also simply fork the OkHttp ModelLoader and DataFetcher, register your forked ModelLoader, and get direct access to the OkHttp client for every request.

提交回复
热议问题