Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion insert-bench.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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)) {
Expand Down