@MrFiliper if I recall you get it as follows:
// no function just key
$var = $request->key
which is equal to
echo ($_REQUEST['key']);
///you could also
$var = $request['key']
Note if it is an API returning XML lets say Pardot then you would parse the curl to xml
$response = new SimpleXMLElement( $pardotApiResponse );
if ( $response->result) {
$campaign = $response->result
}
also worth noting that $name = $request->input('user.name'); only works if e Content-Type header of the request is properly set to application/json
is response coming form an API or form? is a GET or a POST, via curl() or how?
btw, this the request getContent() method.
/**
* Returns the request body content.
*
* @param bool $asResource If true, a resource will be returned
*
* @return string|resource The request body content or a resource to read the body stream
*
* @throws \LogicException
*/
public function getContent($asResource = false)
{
$currentContentIsResource = is_resource($this->content);
if (true === $asResource) {
if ($currentContentIsResource) {
rewind($this->content);
return $this->content;
}
// Content passed in parameter (test)
if (is_string($this->content)) {
$resource = fopen('php://temp', 'r+');
fwrite($resource, $this->content);
rewind($resource);
return $resource;
}
$this->content = false;
return fopen('php://input', 'rb');
}
if ($currentContentIsResource) {
rewind($this->content);
return stream_get_contents($this->content);
}
if (null === $this->content || false === $this->content) {
$this->content = file_get_contents('php://input');
}
return $this->content;
}