当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Http_Client::getLastRawRequest方法代码示例

本文整理汇总了PHP中Zend_Http_Client::getLastRawRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Http_Client::getLastRawRequest方法的具体用法?PHP Zend_Http_Client::getLastRawRequest怎么用?PHP Zend_Http_Client::getLastRawRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Http_Client的用法示例。


在下文中一共展示了Zend_Http_Client::getLastRawRequest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testContentTypeAdditionlInfo

 /**
  * @group ZF2-78
  * @dataProvider parameterArrayProvider
  */
 public function testContentTypeAdditionlInfo($params)
 {
     $content_type = 'application/x-www-form-urlencoded; charset=UTF-8';
     $this->client->setUri($this->baseuri . 'testPostData.php');
     $this->client->setHeaders(array('Content-Type' => $content_type));
     $this->client->setMethod(\Zend\Http\Request::METHOD_POST);
     $this->client->setParameterPost($params);
     $this->client->send();
     $request = Request::fromString($this->client->getLastRawRequest());
     $this->assertEquals($content_type, $request->headers()->get('Content-Type')->getFieldValue());
 }
开发者ID:nsenkevich,项目名称:zf2,代码行数:15,代码来源:CommonHttpTests.php

示例2: testGetLastRawRequest

 /**
  * Test we can get the last request as string
  *
  */
 public function testGetLastRawRequest()
 {
     $this->client->setUri($this->baseuri . 'testHeaders.php');
     $this->client->setParameterGet(array('someinput' => 'somevalue'));
     $this->client->setHeaders(array('X-Powered-By' => 'My Glorious Golden Ass'));
     $this->client->setMethod('TRACE');
     $res = $this->client->send();
     if ($res->getStatusCode() == 405 || $res->getStatusCode() == 501) {
         $this->markTestSkipped("Server does not allow the TRACE method");
     }
     $this->assertEquals($this->client->getLastRawRequest(), $res->getBody(), 'Response body should be exactly like the last request');
 }
开发者ID:RomanShumkov,项目名称:zf2,代码行数:16,代码来源:CommonHttpTests.php

示例3: testMultibyteRawPostDataZF2098

 /**
  * Test that we properly calculate the content-length of multibyte-encoded
  * request body
  *
  * This may file in case that mbstring overloads the substr and strlen
  * functions, and the mbstring internal encoding is a multibyte encoding.
  *
  * @link http://framework.zend.com/issues/browse/ZF-2098
  */
 public function testMultibyteRawPostDataZF2098()
 {
     $this->_client->setAdapter('Zend\\Http\\Client\\Adapter\\Test');
     $this->_client->setUri('http://example.com');
     $bodyFile = __DIR__ . '/_files/ZF2098-multibytepostdata.txt';
     $this->_client->setRawBody(file_get_contents($bodyFile));
     $this->_client->setEncType('text/plain');
     $this->_client->setMethod('POST');
     $this->_client->send();
     $request = $this->_client->getLastRawRequest();
     if (!preg_match('/^content-length:\\s+(\\d+)/mi', $request, $match)) {
         $this->fail("Unable to find content-length header in request");
     }
     $this->assertEquals(filesize($bodyFile), (int) $match[1]);
 }
开发者ID:RomanShumkov,项目名称:zf2,代码行数:24,代码来源:StaticTest.php


注:本文中的Zend_Http_Client::getLastRawRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。