Gravy
Gravy

Reputation: 12445

Goutte / GuzzleHTTP Get the Content-Length / Size of the response body

I am using https://github.com/FriendsOfPHP/Goutte to scrape a page. No probs there.

I am trying to get the Content-Length from the client response object, but cannot see how I can do this.

Upvotes: 1

Views: 4528

Answers (1)

Alex2php
Alex2php

Reputation: 11250

Clicking through the docs... Use $response = $client->getInternalResponse() to get a Symfony\Component\BrowserKit\Response which as a $response->getHeader('Content-Length') available. :-)

Upvotes: 1

Related Questions