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


PHP HttpRequest::getRawRequestMessage方法代码示例

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


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

示例1: testRemoveUsersCapabilities

 public function testRemoveUsersCapabilities()
 {
     $a = array('RequestMethod' => 'RemoveUserCapabilities', 'OwnerID' => 'efb00dbb-d4ab-46dc-aebc-4ba83288c3c0');
     $r = new HttpRequest($this->server_url, HttpRequest::METH_POST);
     $r->addPostFields($a);
     $r->send();
     echo $r->getRawRequestMessage();
     echo "\n";
     echo $r->getRawResponseMessage();
     echo "\n";
     $this->assertEquals(200, $r->getResponseCode());
 }
开发者ID:QuillLittlefeather,项目名称:mgm-simiangrid,代码行数:12,代码来源:UserServiceTests.php

示例2:

//set the soap message for the request
$xmlSoapMessage = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetWeather xmlns="http://www.webserviceX.NET">
<CityName>singapore</CityName>
<CountryName>singapore</CountryName>
</GetWeather>
</soap:Body>
</soap:Envelope>';
$r->setBody($xmlSoapMessage);
try {
    $r->send();
    echo '<h2>Request Header</h2>';
    echo '<pre>';
    print_r($r->getRawRequestMessage());
    echo '</pre>';
    $responseCode = $r->getResponseCode();
    $responseHeader = $r->getResponseHeader();
    $responseBody = $r->getResponseBody();
    echo '--------------------------------------------------------------------------------------------<br/>';
    echo '<h2>Rseponse Code</h2>';
    echo "resonse code " . $responseCode . "<br/>";
    // echo "resonse header" . $responseHeader["location"] . "<br/>";
    echo '<h2>Rseponse Header</h2>';
    echo '<pre>';
    print_r($responseHeader);
    echo '</pre>';
    echo '<h2>Rseponse Body</h2>';
    echo '<pre>';
    print_r($responseBody);
开发者ID:jipengxiang,项目名称:phpWebService,代码行数:31,代码来源:temperatureConversionSOAP.php

示例3: header

    $response->send();
    exit;
}
// Header handling
foreach (array('Content-Type') as $name) {
    $content = $response->getHeader($name);
    if ($content) {
        header("{$name}: {$content}");
    }
}
$debug = 0;
// debugging
if ($debug) {
    echo "DEBUGGING CALL TO <a href='{$url}'>{$url}</a>:\n<br>";
    echo 'Seen by pecl extension as:' . $request->getUrl();
    echo '<h2>Request</h2> <pre>' . $request->getRawRequestMessage() . '</pre>';
    echo '<h2>Response</h2> <pre>' . $request->getRawResponseMessage() . '</pre>';
    echo '<h2>Output headers</h2> <pre>';
    print_r(headers_list());
    print '</pre>';
    echo '<h2>Content</h2>';
    echo $response->getBody();
    exit;
}
// well, that's our body
$contents = $response->getBody();
// Take a short look if we got HTML (important for rewrite engine)
$is_html = stripos($response->getHeader('Content-Type'), 'html') !== false;
// rewrite the page...
$db->driver->rewrite_page($url, $contents, $is_html);
// and print it out.
开发者ID:BackupTheBerlios,项目名称:biokemika-svn,代码行数:31,代码来源:proxy.php


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