我正在尝试将 PUT 方法与Zend Http 客户端一起使用,但我无法将参数添加到请求中。
这是我的代码片段:
$client = new Zend_Http_Client($this->url);
$client->setAuth($this->username, $this->password, Zend_Http_Client::AUTH_BASIC);
$client->setParameterPut('fruit',$var);
$result = $client->request('PUT');
$data = $result->getBody();
我之前已经在代码中声明了“url”、“username”、“password”和“var”。