當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。