diff --git a/insert-bench.php b/insert-bench.php index 875677b..3d9b7ce 100644 --- a/insert-bench.php +++ b/insert-bench.php @@ -28,7 +28,8 @@ // Re-create the database for each attempt $db->send('delete', '/benchmark_db'); $db->send('put', '/benchmark_db'); - + //I am add this alias, because in sprintf method, param $method was undefined. I do not know, did should not be done this way ? + $method = $config['method']; echo sprintf("-> %s %d docs:\n", $method, $docCount); @@ -148,6 +149,8 @@ public function send($method, $resource, $document = array()) { $curlOptions = array( CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => strtoupper($method), + //add this header to CouchDB 1.6.1, otherwise server return 415 error code + CURLOPT_HTTPHEADER => array('Content-Type:application/json'), ); if (!empty($document)) {