Open lijiebin opened 7 years ago
Add to RestClient
/**
* @param string $form params
*
* @return $this
*/
public function setFormParams($params)
{
unset($this->guzzleParams['headers']['Accept'], $this->guzzleParams['headers']['Content-Type']);
$this->guzzleParams['form_params'] = $params;
return $this;
}
Add to GatewayController
private function simpleRequest(Request $request, RestClient $client)
{
//...
if ($request->isMethod('post')) {
$client->setFormParams($request->post());
} else {
$client->setBody($request->getContent());
}
//...
}
Not the best solution
Because the data of
setBody
not in$_POST
but inphp://input