Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add note about getContent/getHeaders to the README #56

Open
wants to merge 1 commit into from

5 participants

@mheap

It took me a while to work out how to get just the content from a response from a request. No reason not to add this to the README.

@m47730

+1 for this.

It's really a common behaviour to get header or content of a page, and this library is really simple to use, except you have to navigate to find out the right method to manage the response.
With this two lines addiction you save a lot of time to poor soul developer like me :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 22, 2012
  1. Add note about getContent/getHeaders to the README

    Michael Heap authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 README.md
View
4 README.md
@@ -7,7 +7,9 @@ $browser = new Buzz\Browser();
$response = $browser->get('http://www.google.com');
echo $browser->getLastRequest()."\n";
-echo $response;
+// $response is an object.
+// You can use $response->getContent() or $response->getHeaders() to get only one part of the response.
+echo $response;
```
You can also use the low-level HTTP classes directly.
Something went wrong with that request. Please try again.