0

In my gradle dependencies, I've added:

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'

And then I use Picasso normally, for example:

Picasso.with(context)
.load(url)
.placeholder(R.drawable.ic_contact_picture)
.error(R.drawable.ic_contact_picture)
.into(imageView);

Now, the url is a php script from which I'm doing echo file_get_contents("$imagepath"); The image is being fetched and displayed by picasso.

But before doing echo, I'm also setting some headers like:

header("Last-Modified: ".gmdate("D, d M Y H:i:s", $lastModified)." GMT");
header("Etag: $etagFile");
header('Cache-Control: max-age=60');

Now, whenever picasso will consult okhttp, will okhttp send these headers with the http request? How can verify whether they are sent?

user5155835
  • 4,392
  • 4
  • 53
  • 97

1 Answers1

0

Try going to that url with Chrome and see this SO answer for how to inspect HTTP headers in Chrome.

This website will show you the headers sent by an HTTP client. If you're on Linux then this SO answer provides a way to this using TCPDump

Community
  • 1
  • 1
erapert
  • 1,383
  • 11
  • 15
  • LIke I said, I want test whether the http client (okhttp) really sends back those headers or not. A browser is not helpful here – user5155835 Oct 29 '15 at 02:06