We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POST
Because the data of setBody not in $_POST but in php://input
setBody
$_POST
php://input
private function simpleRequest(Request $request, RestClient $client) { if ($request->getRoute()->isAggregate()) throw new NotImplementedException('Aggregate ' . strtoupper($request->method()) . 's are not implemented yet'); $client->setBody($request->getContent()); if (count($request->allFiles()) !== 0) { $client->setFiles($request->allFiles()); } $parametersJar = array_merge($request->getRouteParams(), ['query_string' => $request->getQueryString()]); $response = $client->syncRequest($this->actions->first()->first(), $parametersJar); return $this->presenter->format((string)$response->getBody(), $response->getStatusCode()); }
The text was updated successfully, but these errors were encountered:
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
Sorry, something went wrong.
No branches or pull requests
Because the data of
setBody
not in$_POST
but inphp://input
The text was updated successfully, but these errors were encountered: