library/Garp/Content/Api/Rest.php
public function post(array $params, array $postData) {
        $this->_validatePostParams($params, $postData);
        $model = $this->_normalizeModelName($params['datatype']);
        $contentManager = $this->_getContentManager($model);
        $primaryKey = $contentManager->create($postData);
        $record = array_get(
            array_get(
                $this->get(
                    array(
                        'datatype' => $params['datatype'],
                        'id' => $primaryKey
                    )
                ),
                'data',
                array()
            ),
            'result',
            array()
        );
        $response = array(
            'success' => true,
            'result' => $record,
            'link' => (string)new Garp_Util_FullUrl(
                array(array('datatype' => $params['datatype'], 'id' => $primaryKey), 'rest')
            )
        );
        return $this->_formatResponse($response, 201);
    }
public function post(array $params, array $postData) {
        $this->_validatePostParams($params, $postData);
        $model = $this->_normalizeModelName($params['datatype']);
        $contentManager = $this->_getContentManager($model);
        $primaryKey = $contentManager->create($postData);
        $record = array_get(
            array_get(
                $this->get(
                    array(
                        'datatype' => $params['datatype'],
                        'id' => $primaryKey
                    )
                ),
                'data',
                array()
            ),
            'result',
            array()
        );
        $response = array(
            'success' => true,
            'result' => $record,
            'link' => (string)new Garp_Util_FullUrl(
                array(array('datatype' => $params['datatype'], 'id' => $primaryKey), 'rest')
            )
        );
        return $this->_formatResponse($response, 201);
    }
public function post ( array $ params , array $ postData ) { $ this -> _validatePostParams ( $ params , $ postData ) ; $ model = $ this -> _normalizeModelName ( $ params [ 'datatype' ] ) ; $ contentManager = $ this -> _getContentManager ( $ model ) ; $ primaryKey = $ contentManager -> create ( $ postData ) ; $ record = array_get ( array_get ( $ this -> get ( array ( 'datatype' => $ params [ 'datatype' ] , 'id' => $ primaryKey ) ) , 'data' , array ( ) ) , 'result' , array ( ) ) ; $ response = array ( 'success' => true , 'result' => $ record , 'link' => ( string ) new Garp_Util_FullUrl ( array ( array ( 'datatype' => $ params [ 'datatype' ] , 'id' => $ primaryKey ) , 'rest' ) ) ) ; return $ this -> _formatResponse ( $ response , 201 ) ; }
POST a new record

@param array $params
@param array $postData
@return array
POST a new record