private function assertRequestHasValidBody(RequestInterface $request)
    {
        $validMethods = [
            BuzzRequestInterface::METHOD_POST,
            BuzzRequestInterface::METHOD_PUT,
            BuzzRequestInterface::METHOD_DELETE,
            BuzzRequestInterface::METHOD_PATCH,
            BuzzRequestInterface::METHOD_OPTIONS,
        ];

        // The Buzz Curl client does not send request bodies for request methods such as GET, HEAD and TRACE. Instead of
        // silently ignoring the request body in these cases, throw an exception to make users aware.
        if ($this->client instanceof Curl &&
            $request->getBody()->getSize() &&
            !in_array(strtoupper($request->getMethod()), $validMethods, true)
        ) {
            throw new HttplugException\RequestException(
                sprintf('%s does not support %s requests with a body', Curl::class, $request->getMethod()),
                $request
            );
        }
    }