本文整理汇总了PHP中Guzzle\Http\Message\RequestFactory::get方法的典型用法代码示例。如果您正苦于以下问题:PHP RequestFactory::get方法的具体用法?PHP RequestFactory::get怎么用?PHP RequestFactory::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Guzzle\Http\Message\RequestFactory
的用法示例。
在下文中一共展示了RequestFactory::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAddsQueryStringAuth
/**
* @covers Guzzle\Aws\QueryStringAuthPlugin
*/
public function testAddsQueryStringAuth()
{
$signature = new SignatureV2('a', 'b');
$plugin = new QueryStringAuthPlugin($signature, '2009-04-15');
$this->assertSame($signature, $plugin->getSignature());
$this->assertEquals('2009-04-15', $plugin->getApiVersion());
$request = RequestFactory::get('http://www.test.com/');
$request->getEventManager()->attach($plugin);
$request->getEventManager()->notify('request.before_send');
$qs = $request->getQuery();
$this->assertTrue($qs->hasKey('Timestamp') !== false);
$this->assertEquals('2009-04-15', $qs->get('Version'));
$this->assertEquals('2', $qs->get('SignatureVersion'));
$this->assertEquals('HmacSHA256', $qs->get('SignatureMethod'));
$this->assertEquals('a', $qs->get('AWSAccessKeyId'));
}