request->getBody()) { $this->request->setBody('{}'); } // Never send the Expect header when interacting with a JSON query service $this->request->removeHeader('Expect'); // Always send JSON requests as a raw string rather than using streams to avoid issues with // cURL error code 65: "necessary data rewind wasn't possible". // This could be removed after PHP addresses https://bugs.php.net/bug.php?id=47204 $this->request->getCurlOptions()->set(CurlHandle::BODY_AS_STRING, true); } }