private function addPostData($Resource, $data) {
        if (!empty($data)) {
            switch ($this->Request->getContentTypeCode()) {
                case Request::CONTENT_TYPE_UNDEFINED:
                    $string = http_build_query($data);
                    break;
                case Request::CONTENT_TYPE_JSON:
                    $string = json_encode($data);
                    break;
                case Request::CONTENT_TYPE_TEXT:
                    $string = (string) $data;
                    break;
                case Request::CONTENT_TYPE_XML:
                    if ($data instanceof DOMDocument) {
                        $string = $data->saveXML();
                    } else {
                        $string = (string) $data;
                    }
                    break;
                default:
                    throw new HttpContentTypeException();
            }
            curl_setopt_array($Resource, array(
                CURLOPT_POST    => true,
                CURLOPT_POSTFIELDS => $string,
            ));
        }
    }