public function testResetParametersClearAll()
 {
     $this->_client->setMethod('POST');
     $this->_client->setRawData('Foo Bar');
     $this->_client->setHeaders('Content-Length', 7);
     $this->_client->setHeaders('Content-Type', 'text/plain');
     $this->_client->setHeaders('Accept-Language', 'en');
     $this->_client->resetParameters(true);
     $this->assertEquals('GET', $this->_client->getMethod());
     $this->assertEquals(null, $this->_client->getRawData());
     $this->assertEquals(null, $this->_client->getHeader('Content-Length'));
     $this->assertEquals(null, $this->_client->getHeader('Content-Type'));
     $this->assertEquals(null, $this->_client->getHeader('Accept-Language'));
 }
<h1>Test EasyRdf_HTTP_Client Get</h1>
<?php 
echo form_tag();
echo text_field_tag('uri', 'http://tomheath.com/id/me', array('size' => 50));
?>
<br />
<?php 
echo label_tag('accept', 'Accept Header: ') . select_tag('accept', $accept_options);
echo submit_tag();
echo form_end_tag();
?>

<?php 
if (isset($_REQUEST['uri'])) {
    $client = new EasyRdf_Http_Client($_REQUEST['uri']);
    $client->setHeaders('Accept', $_REQUEST['accept']);
    $response = $client->request();
    ?>

    <p class="status">
    <b>Status</b>: <?php 
    echo $response->getStatus();
    ?>
<br />
    <b>Message</b>: <?php 
    echo $response->getMessage();
    ?>
<br />
    <b>Version</b>: HTTP/<?php 
    echo $response->getVersion();
    ?>
Ejemplo n.º 3
0
 public function testRedirectionCounterShouldStartAtZero()
 {
     $this->_client->setHeaders('Accept-Encoding', null);
     $this->assertEquals($this->_client->getRedirectionsCount(), 0);
 }