setPost() публичный Метод

Set cURL option for POST
public setPost ( boolean $post = false ) : Curl
$post boolean
Результат Curl
Пример #1
0
<?php

require_once '../../bootstrap.php';
use Pop\Curl\Curl;
try {
    $curl = new Curl('http://pop.localhost/examples/curl/curl-process.php');
    $curl->setPost(true);
    $curl->setFields(array('name' => 'Bubba', 'email' => '*****@*****.**'));
    $curl->execute();
    echo $curl->getBody();
} catch (\Exception $e) {
    echo $e->getMessage() . PHP_EOL . PHP_EOL;
}
Пример #2
0
 public function testSetPost()
 {
     $c = new Curl('http://www.popphp.org/version', array(CURLOPT_HEADER => false, CURLOPT_RETURNTRANSFER => true));
     $c->setPost(true);
     $this->assertTrue($c->isPost());
 }