Changes

Jump to navigation Jump to search
162 bytes added ,  23:20, 12 September 2011
:<code>curl -i "bob:alice@localhost:8984/rest/factbook"</code>
==Response Media Content Type==
As the correct result content type cannot always be dynamically determined, the user can manually adjust the content type. The final content type of a REST response is chosen in several steps:
# The By default, the content type of a response depends on the chosen operation:
#* Command results are returned as <code>text/plain</code>
#* Query results are returned as <code>application/xml</code>
# The default content type can be is overwritten by specifying if a [[Serialization|serialization method]]is specified, either as [[#Query Parameters|query parameter]] or within the XQuery expression. The following methods are available:
#*<code>xml</code> → <code>application/xml</code>
#*<code>xhtml</code> → <code>text/html</code>
#*<code>raw</code> → <code>application/octet-stream</code>
#*<code>json</code> or <code>jsonml</code> → <code>application/json</code>
# The content type is overwritten in any case if a specific [[Serialization|media-type]] is chosen, again as query parameter or within the query.
As an The following three example, the following URLs requests will all use return <code>application/xml</code> as response media content-type:
:<code>http://admin:admin@localhost:8984/rest?query=1<a/></code><br/><code>http://admin:admin@localhost:8984/rest?query=1<a/>&method=xml</code><br/><code>http://admin:admin@localhost:8984/rest?query=1<a/>&media-type=application/xml</code>
==Usage Examples==
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu