0
我試圖從安全域獲取照片。 爲了能夠得到照片,我必須發送HTTP請求 - 或發送Cookie - 以獲取照片。發送HTTP請求以獲取cardslib中的照片
此代碼不起作用,因爲它發送正常的請求。
CardThumbnail thumb = new CardThumbnail(getActivity());
String photoUrl = "https://secure.website/image.png";
thumb.setUrlResource(photoUrl);
我需要的是通過發送所需的cookie來獲取此安全照片。
在改造,我用:
request.addHeader("Cookie", "SESSION=123; CSRF_TOKEN=" + token);
但什麼是cardslib解決?
謝謝。但我需要使用UniversalImageLoader而不是畢加索。你有解決UIL的問題嗎? –
@ArabAgile你可以用同樣的方法整合UIL。我剛剛編輯了答案。 Hovewer我不太清楚這個庫是否可以爲http請求添加標題。我在SO中報告了該功能的鏈接。 –