<?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; }
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()); }