setHeaders

document.setHeaders({someContent: 'someValue'}, true);
JSONObject headers = new JSONObject().put("someContent", "someValue");

document.setHeaders(headers, true);
<?php

use \Kuzzle\Document;

// ...

$headers = [
  'header' => 'value'
];

/**
 * @var $document Document
 */
$document->setHeaders($headers);

This is a helper function returning itself, allowing to easily chain calls.


setHeaders(content, [replace])

ArgumentsTypeDescription
contentJSON ObjectNew content
replacebooleantrue: replace the current content with the provided data, false: merge it

Note: by default, the replace argument is set to false


Return value

Returns this Document object to allow chaining.