source/Http/CurlTransport.php
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,
            ));
        }
    }
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,
            ));
        }
    }
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 , ) ) ; } }
Add POST data for request
@param resource $Resource libcurl handler
@param mixed $data POST parameters
@throws HttpContentTypeException when use unsupported type of content
Add POST data for request