X-Git-Url: https://git.cweiske.de/shpub.git/blobdiff_plain/5c5fff50b8e88170cbf6cb51a8158af7caa00b10..702a671539587fc1ad89258e8c3eb5cf006428b4:/src/shpub/Request.php diff --git a/src/shpub/Request.php b/src/shpub/Request.php index edca12a..0924dda 100644 --- a/src/shpub/Request.php +++ b/src/shpub/Request.php @@ -53,6 +53,21 @@ class Request return $this->req->addUpload($fieldName, $filename); } + /** + * Add one or multiple POST parameters. + * Automatically adds them as array or as string. + * + * @param string $key Parameter name + * @param string|array $values One or multiple values + */ + public function addPostParameter($key, $values) + { + if (count($values) == 1) { + $values = reset($values); + } + $this->req->addPostParameter($key, $values); + } + protected function printCurl() { $command = 'curl';