public function registerMiddleware(IMiddleware $middleware): IOAuthClient
    {
        $middleware->setClient($this);
        foreach ($middleware::statusCode() as $statusCode) {
            $this->postRequestMiddlewares[$statusCode][] = $middleware;
        }

        return $this;
    }