Changes

Jump to navigation Jump to search
1,073 bytes added ,  00:38, 26 February 2012
no edit summary
</html>
</pre>
'''Example 3: Example with content Content-type ending with +xml, e.g. image/svg+xml.'''
'''Query:'''
'''Result:'''
<pre class="brush:xqueryxml"><http:response status="200" message="OK">
<http:header name="ETag" value="W/&quot;11b6d-4ba15ed4&quot;"/>
<http:header name="Age" value="9260"/>
...
</svg></pre>
 
'''Example 4: POST request to the BaseX REST Service, specifying a username and password.'''
 
'''Query:'''
<pre class="brush:xquery">
let $request :=
<http:request href='http://localhost:8984/rest'
method='post' username='admin' password='admin' send-authorization='true'>
<http:body media-type='application/xml'>
<query xmlns="http://basex.org/rest">
<text><![CDATA[
<html>{
for $i in 1 to 5
return <div>Section {$i }</div>
}</html>
]]></text>
</query>
</http:body>
</http:request>
return http:send-request($request)
</pre>
 
'''Result:'''
<pre class="brush:xml">
<http:response xmlns:http="http://expath.org/ns/http-client" status="200" message="OK">
<http:header name="Content-Length" value="135"/>
<http:header name="Content-Type" value="application/xml"/>
<http:header name="Server" value="Jetty(6.1.26)"/>
<http:body media-type="application/xml"/>
</http:response>
<html>
<div>Section 1</div>
<div>Section 2</div>
<div>Section 3</div>
<div>Section 4</div>
<div>Section 5</div>
</html>
</pre>
 
[[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu