SimpleBrowser::put PHP Method

put() public method

Fetches the page content with a PUT request.
public put ( string/SimpleUrl $url, hash/SimpleFormEncoding $parameters = false, string $content_type = false ) : string
$url string/SimpleUrl
$parameters hash/SimpleFormEncoding
$content_type string MIME Content-Type of the request body
return string Content of page.
    public function put($url, $parameters = false, $content_type = false)
    {
        if (!is_object($url)) {
            $url = new SimpleUrl($url);
        }
        return $this->load($url, new SimplePutEncoding($parameters, $content_type));
    }

Usage Example

コード例 #1
0
ファイル: acceptance_test.php プロジェクト: sebs/simpletest
 function testPutWithXmlEncoding()
 {
     $browser = new SimpleBrowser();
     $this->assertTrue($browser->put($this->samples() . 'request_methods.php', '<a><b>c</b></a>', 'application/xml'));
     $this->assertEqual($browser->getResponseCode(), 201);
     $this->assertPattern('/c/', $browser->getContent());
 }