【发布时间】:2017-04-04 10:24:33
【问题描述】:
我在 Codeigniter 中有如下 curl 请求:
$order = [
'index' => 'Value',
'index2' => 'Value2'
];
$this->curl->create($this->base_url.'order/');
$this->curl->http_login($creds['username'], $creds['password']);
$this->curl->ssl(TRUE, 2, 'certificates/certificate.pem');
$this->curl->option(CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));
$this->curl->option(CURLOPT_FAILONERROR, FALSE);
$this->curl->post(json_encode($order));
$data = $this->curl->execute();
现在我需要在使用 Guzzle 的 Laravel 中发出相同的请求。如何将其转换为 Guzzle 请求?
【问题讨论】: