forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Formats
Arxisos edited this page Dec 30, 2011
·
4 revisions
ServiceStack supports 6 response formats out of the box:
- JSON
- XML
- JSV (hybrid CSV-style escaping + JSON format that is optimized for both size and speed)
- HTML 5 (provides a readable and semantic HTML layout letting you visualize all the data returned by your web service)
- CSV
- Markdown Razor (Razor combined with markdown)
You can define which format should be used by adding ?format={format} to the end of the URL.
?format=json?format=xml?format=jsv?format=csv?format=html
Example: http://www.servicestack.net/ServiceStack.Hello/servicestack/hello/World!?format=json
Alternatively ServiceStack also recognizes which format should be used with the Content-Type http header:
Content-Type application/jsonContent-Type application/xml
As you can see, this approach only works with json and xml.
/servicestack/[xml|json|html|jsv|csv]/[syncreply|asynconeway]/[servicename]