0

Using Picasso I want to load images from Instagram media url like :

https://instagram.com/p/7-6FIJjMym/media/

The url returns a HTTP/1.1 302 FOUND and a location header for redirection like:

https://scontent.cdninstagram.com/hphotos-xpt1/t51.2885-15/s320x320/e35/1530612_903806373047604_222778181_n.jpg

Here is my code:

String url="https://instagram.com/p/7-6FIJjMym/media/"
Picasso.with(MainActivity.this).load(url).into((ImageView)findViewById(R.id.imageView));

Here is my log:

12-01 10:40:33.134 18439-18439/ D/Picasso: Main        created      [R0] Request{https://instagram.com/p/7-6FIJjMym/media/}
12-01 10:40:33.139 18439-18542/ D/Picasso: Dispatcher  enqueued     [R0]+5ms 
12-01 10:40:33.142 18439-18544/ D/Picasso: Hunter      executing    [R0]+8ms 

It won't load the image.

Nima
  • 112
  • 1
  • 2
  • 12
  • @AntonShkurenko Updated. url is set to `https://instagram.com/p/7-6FIJjMym/media/` – Nima Dec 01 '15 at 08:26
  • 1
    Seems like this is wrong url, Picasso can't load an image from redirect. Pass to it good url. – Anton Shkurenko Dec 01 '15 at 08:27
  • maybe it cant get images from https -- https://github.com/square/picasso/issues/500 -- if thats the case someone says in there that universal image loader can do https by default – Tasos Dec 01 '15 at 08:44
  • 1
    also have alook here for a possible solution --- http://stackoverflow.com/questions/23562794/doesnt-picasso-support-to-download-images-which-uses-https-protocol/26398617#26398617 – Tasos Dec 01 '15 at 08:49
  • @Tasos Thanks, I will take a look. – Nima Dec 01 '15 at 17:33

0 Answers0