All Verbs | /echo/complex |
---|
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Test.ServiceInterface
Imports Test.ServiceModel.Types
Namespace Global
Namespace Test.ServiceInterface
Public Partial Class EchoComplexTypes
Public Overridable Property SubType As SubType
Public Overridable Property SubTypes As List(Of SubType)
Public Overridable Property SubTypeMap As Dictionary(Of String, SubType)
Public Overridable Property StringMap As Dictionary(Of String, String)
Public Overridable Property IntStringMap As Dictionary(Of Integer, String)
End Class
End Namespace
Namespace Test.ServiceModel.Types
Public Partial Class SubType
Public Overridable Property Id As Integer
Public Overridable Property Name As String
End Class
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /echo/complex HTTP/1.1
Host: test.servicestack.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
subType:
{
id: 0,
name: String
},
subTypes:
[
{
id: 0,
name: String
}
],
subTypeMap:
{
String:
{
id: 0,
name: String
}
},
stringMap:
{
String: String
},
intStringMap:
{
0: String
}
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { subType: { id: 0, name: String }, subTypes: [ { id: 0, name: String } ], subTypeMap: { String: { id: 0, name: String } }, stringMap: { String: String }, intStringMap: { 0: String } }