【发布时间】:2016-01-28 16:44:41
【问题描述】:
在我的 gradle 依赖项中,我添加了:
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.5.0'
然后我正常使用毕加索,例如:
Picasso.with(context)
.load(url)
.placeholder(R.drawable.ic_contact_picture)
.error(R.drawable.ic_contact_picture)
.into(imageView);
现在,url 是一个 php 脚本,我正在使用它 echo file_get_contents("$imagepath");
picasso 正在获取并显示图像。
但在做 echo 之前,我还设置了一些标题,例如:
header("Last-Modified: ".gmdate("D, d M Y H:i:s", $lastModified)." GMT");
header("Etag: $etagFile");
header('Cache-Control: max-age=60');
现在,当毕加索咨询 okhttp 时,okhttp 会在 http 请求中发送这些标头吗?如何验证是否发送?
【问题讨论】:
标签: php android picasso okhttp