private function setPostFields(CurlRequest $curl, Request $request) {
        $postfields = null;
        $content = $request->getContent();

        if (!empty($content)) {
            $postfields = $content;
        } else if (count($request->request->all()) > 0) {
            $postfields = $request->request->all();
        }

        $curl->setOption(CURLOPT_POSTFIELDS, $postfields);
    }