Edit on GitHub

Content Types

ServiceStack supports the following formats:

.NET Service Clients

The different Content Types can be easily consumed using ServiceStack’s Typed Generic Service Clients.

HTTP/REST Endpoints

You can define which format should be used by adding a .{format} extension:

  • .json
  • .xml
  • .jsv
  • .csv
  • .html

Or by appending ?format={format} to the end of the URL:

  • ?format=json
  • ?format=xml
  • ?format=jsv
  • ?format=csv
  • ?format=html

Example: http://test.servicestack.net/hello/World!?format=json

Alternatively ServiceStack also recognizes which format should be used with the Accept http header:

  • Accept: application/json
  • Accept: application/xml

As you can see, this approach only works with json and xml.

Pre-defined Routes

/[xml|json|html|jsv|csv]/[reply|oneway]/[servicename]

Examples:

  • /json/reply/Hello (JSON)
  • /xml/oneway/SendEmail (XML)

SOAP Endpoint

Consume ServiceStack Services via SOAP using WCF Add Service Reference or ServiceStack generic SOAP Clients.

MQ Endpoint

Consume ServiceStack Services via Message Queue.