public function handleRequest(RequestInterface $request, callable $next)
    {
        $this->setUri($request->getUri()->getPath());
        $this->setMethod(strtoupper($request->getMethod()));
        $this->setEntityBody($request->getBody()->__toString());

        $header = $this->getHeader();
        if (null !== $header) {
            $request = $request->withHeader('Authorization', $header);
        }

        return $next($request);
    }