Changes

Jump to navigation Jump to search
182 bytes added ,  23:14, 12 September 2011
==Response Media Type==
The media content type of a REST response is chosen in several steps (<font color='gray'>to be revised for Version 6.8</font>):
# The value content type of a response depends on the [[#Query Parameters|wrap parameter]] determines the initial media type (default: <code>yes</code>)chosen operation:#* Command results are returned as <code>yes<text/code> → <code>application/xmlplain</code>#* Query results are returned as <code>no<application/code> → <code>text/plainxml</code># If The default content type can be overwritten by specifying a valid value for "<code>[[Serialization|method</code>" has been specified via the ]], either as [[#Query Parameters|output query parameter]], or within the media type is overwrittenXQuery expression. The following methods are available:
#*<code>xml</code> → <code>application/xml</code>
#*<code>xhtml</code> → <code>applicationtext/xhtml+xmlhtml</code>
#*<code>html</code> → <code>text/html</code>
#*<code>text</code> → <code>text/plain</code>
# Last, the type is overwritten if a valid value for "*<code>raw</code> → <code>mediaapplication/octet-typestream</code>#*<code>json</code> or <code>jsonml</code> → <code>application/json</code>" has been specified via the # The type is overwritten in any case if a specific [[#Query ParametersSerialization|output parametermedia-type]]is chosen, again as query parameter or within the query.
To give two examplesAs an example, the following URLs will all choose use <code>textapplication/plainxml</code> as response media type:
:<code>http://admin:admin@localhost:8984/rest?query=1&wrap=yes:</code><br/><code>http://admin:admin@localhost:8984/rest?query=1&method=xml:</code><br/><code>http://admin:admin@localhost:8984/rest?query=1&media-type=application/xml</code>
==Usage Examples==
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu