本文整理汇总了PHP中Guzzle\Http\Message\Request::getPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::getPath方法的具体用法?PHP Request::getPath怎么用?PHP Request::getPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Guzzle\Http\Message\Request
的用法示例。
在下文中一共展示了Request::getPath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: debug
public function debug()
{
$r = new Response();
var_dump($r->getReasonPhrase());
$req = new Request();
$req->getPath();
}
示例2: testRequestHasPath
/**
* @covers Guzzle\Http\Message\Request::getPath
* @covers Guzzle\Http\Message\Request::setPath
*/
public function testRequestHasPath()
{
$this->assertEquals('/', $this->request->getPath());
$this->assertEquals($this->request, $this->request->setPath('/index.html'));
$this->assertEquals('/index.html', $this->request->getPath());
$this->assertEquals($this->request, $this->request->setPath('index.html'));
$this->assertEquals('/index.html', $this->request->getPath());
}
示例3: signRequest
/**
* @param \Guzzle\Http\Message\Request $request
*/
public function signRequest(Request $request)
{
$url = $request->getPath();
if ('POST' == $request->getMethod() && $request instanceof EntityEnclosingRequest) {
$body = (string) $request->getBody();
$hash = $this->signature->generate($body);
} else {
$url .= '?' . $request->getQuery();
$hash = $this->signature->generate($url);
}
$request->addCookie('acquia_solr_time', $this->signature->getRequestTime());
$request->addCookie('acquia_solr_nonce', $this->signature->getNonce());
$request->addCookie('acquia_solr_hmac', $hash . ';');
// The timestamp should be current for each request.
$this->signature->unsetRequestTime();
}
示例4: testPermitsFalsyComponents
/**
* @covers Guzzle\Http\Message\Request::getHost
* @covers Guzzle\Http\Message\Request::getPath
* @covers Guzzle\Http\Message\Request::getQuery
*/
public function testPermitsFalsyComponents()
{
$request = new Request('GET', 'http://0/0?0');
$this->assertSame('0', $request->getHost());
$this->assertSame('/0', $request->getPath());
$this->assertSame('0=', $request->getQuery(true));
$request = new Request('GET', '0');
$this->assertEquals('/0', $request->getPath());
}
示例5: getRequestPath
private function getRequestPath(\Guzzle\Http\Message\Request $request)
{
// $ret = str_replace('/app_dev.php', '', $request->getPath());
$ret = $request->getPath();
return $ret;
}
示例6: getRequestName
private function getRequestName(Request $request)
{
return (string) $request->getPath();
}