本文整理汇总了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());
}
示例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);
示例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.