Loading TOC...

MarkLogic Server 11.0 Product Documentation
HEAD /v1/documents

Summary

Returns the same headers as an equivalent GET (content/metadata fetch) on the /documents service. For example, you can use the returned content length to determine the end boundary for iterating over sub-binaries.

URL Parameters
category* The category of data for which to generate headers. Category can be specified multiple times to request any combination of content and metadata. Valid categories: content (default), metadata, metadata-values, collections, permissions, properties, and quality. Use metadata to request all categories except content.
database? Perform this operation on the named content database instead of the default content database associated with the REST API instance. Using an alternative database requires the "eval-in" privilege; for details, see Security Requirements in the REST Application Developer's Guide.
format? The format of metadata returned by the request, either xml or json. The format parameter applies only to metadata and overrides any format specified in the Accept header.
txid? The transaction identifier of the multi-statement transaction in which to service this request. Use the /transactions service to create and manage multi-statement transactions.
uri The URI of a document in the database.
Request Headers
Accept* The expected MIME type of the response. Metadata may only be returned as application/json or application/XML (the default).
Range? Specifies a zero-based start index or start and end indices for retrieving a sub-binary from a binary document.
Response Headers
Content-Type The MIME type of the content that would be returned by a GET.
Etag An opaque version identifier for the requested document, suitable for subsequent use in an If-None-Match or If-Match header. This header is only available when content versioning is enabled. For details, see Client-Side Cache Management Using Content Versioning in the REST Application Developer's Guide.

Response

Upon success, MarkLogic Server returns status 200 (OK) and the same headers that are returned by an equivalent GET on the /documents service.

Usage Notes

Use this method to determine what headers an equivalent GET will return. For example, the returned content length header may be used to set the ending boundary when using ranges to iterate over sub-binaries in a binary document.

Example

curl --anyauth --user user:password -X HEAD -i \
  -H "Accept: multipart/mixed; boundary=picket-fence" \
  'http://localhost:8000/v1/documents?uri=/shakespeare/plays/a_and_c.xml&category=metadata&category=content&format=json'

==> The headers that would be returned by a GET request to the
    same URL.

Server: MarkLogic
Content-Type: text/plain; charset=UTF-8
Connection: close

HTTP/1.1 200 OK
Content-type: multipart/mixed; boundary=picket-fence
Server: MarkLogic
Connection: close
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.