Created
July 21, 2016 11:47
-
-
Save apb2006/1076f62e36055ab1b5f9755a7f8c9172 to your computer and use it in GitHub Desktop.
BaseX RESTXQ Content Negotiation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module namespace page = 'http://basex.org/modules/web-page'; | |
declare | |
%rest:path("content") | |
%rest:produces("application/json") | |
%output:method("json") | |
function page:content1(){ | |
<json type="object"> | |
<msg>Hello</msg> | |
</json> | |
}; | |
declare | |
%rest:path("content") | |
%rest:produces("text/html") | |
%output:method("html") | |
function page:content2(){ | |
<div>hello</div> | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment