Example #1
0
 /**
  * Add a parameter key and value to the request according to type
  *
  * @param RequestInterface $request The request
  * @param string           $key     The name of the parameter
  * @param string           $value   The value of the parameter
  */
 public function addParameter(RequestInterface $request, $key, $value)
 {
     if ($request->getMethod() == 'POST') {
         $request->setPostField($key, $value);
     } else {
         $request->getQuery()->set($key, $value);
     }
 }
Example #2
0
 public function visit(CommandInterface $command, RequestInterface $request, Parameter $param, $value)
 {
     $request->setPostField($param->getWireName(), $this->prepareValue($value, $param));
 }