-
-
Save MikSDigital/11e929331ab171c8e1718c5f515e399b to your computer and use it in GitHub Desktop.
Set user-agent in guzzle. client->setDefaultOption('headers/User-Agent', 'foo'); does not work for user-agent.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
use Guzzle\Service\Client; | |
// Create a client with a base URL | |
$client = new Client('http://requestb.in/1ivmkhd1'); | |
$client->setUserAgent('myuseragent'); | |
// Send a request to https://github.com/notifications | |
$response = $client->get('')->send(); | |
print($response); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment