improve "x" option, add syndication option
[shpub.git] / src / shpub / Request.php
index edca12aae84749c8d71b57cd462bbd251d797b2b..0924ddae1cf54ba725636b4294e336b2db895dc7 100644 (file)
@@ -53,6 +53,21 @@ class Request
         return $this->req->addUpload($fieldName, $filename);
     }
 
         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';
     protected function printCurl()
     {
         $command = 'curl';