src/Request.php
public function getData($key = null, $default = null) {
        if ($this->hasInput()) {
            return $this->getInput($key, $default);
        } else {
            return $this->getQuery($key, $default);
        }
    }
public function getData($key = null, $default = null) {
        if ($this->hasInput()) {
            return $this->getInput($key, $default);
        } else {
            return $this->getQuery($key, $default);
        }
    }
Gets the query on input depending on the http method.

@param string|null $key Either a string key or null to get the entire array.
@param mixed|null $default The default to return if {@link $key} is not found.
@return mixed|array Returns the value at {@link $key} or the entire array.
@see Request::setData()
@see Request::getInput()
@see Request::getQuery()
@see Request::hasInput()