1
沃森接下來代碼:對話框IBM - 捲曲 - PHP Laravel
curl -u "{username}":"{password}"
-X POST
--form [email protected]
--form name=templateName
"https://gateway.watsonplatform.net/dialog/api/v1/dialogs"
而且我有:
$ch = curl_init();
$data['name'] = $this->post['name'].";type:form";
$data['file'] = $this->getCurlValue($this->post['file'], $this->post['nombre']);
curl_setopt($ch, CURLOPT_URL, $this->url.$this->metodo);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_USERPWD, "{$this->user}:{$this->pass}");
if(count($this->post) > 0){
//curl_setopt($ch, CURLOPT_PUT, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
$output = curl_exec($ch);
curl_close($ch);
json_decode($output);
$這個 - >後有...
$data = Request::only('name', 'file');
我只能回答:{}
我失蹤了什麼? !
謝謝大家......第一次嘗試發送一個文件上傳與捲曲:C
我嘗試用PHP和我不能老是找份工作。在終端進行卷曲非常簡單。此外,我嘗試使用「@」,buuut,帶「@」的捲曲文件棄用... – carlos