Test

<back to all web services

TestUploadWithDto

import Foundation
import ServiceStack

public class TestUploadWithDto : IPost, Codable
{
    public var int:Int
    public var nullableId:Int?
    public var long:Int
    public var double:Double
    public var string:String
    public var dateTime:Date
    public var intArray:[Int]
    public var intList:[Int]
    public var stringArray:[String]
    public var stringList:[String]
    public var pocoArray:[Poco]
    public var pocoList:[Poco]
    public var nullableByteArray:[UInt8?]
    public var nullableByteList:[UInt8?]
    public var nullableDateTimeArray:[Date?]
    public var nullableDateTimeList:[Date?]
    public var pocoLookup:[String:[Poco]]
    public var pocoLookupMap:[String:[[String:Poco]]]
    public var mapList:[String:[String]]

    required public init(){}
}

public class Poco : Codable
{
    public var name:String

    required public init(){}
}


Swift TestUploadWithDto DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /json/reply/TestUploadWithDto HTTP/1.1 
Host: test.servicestack.net 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"int":0,"nullableId":0,"long":0,"double":0,"string":"String","dateTime":"\/Date(-62135596800000-0000)\/","intArray":[0],"intList":[0],"stringArray":["String"],"stringList":["String"],"pocoArray":[{"name":"String"}],"pocoList":[{"name":"String"}],"nullableByteArray":[0],"nullableByteList":[0],"nullableDateTimeArray":["\/Date(-62135596800000-0000)\/"],"nullableDateTimeList":["\/Date(-62135596800000-0000)\/"],"pocoLookup":{"String":[{"name":"String"}]},"pocoLookupMap":{"String":[{"String":{"name":"String"}}]},"mapList":{"String":["String"]}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"int":0,"nullableId":0,"long":0,"double":0,"string":"String","dateTime":"\/Date(-62135596800000-0000)\/","intArray":[0],"intList":[0],"stringArray":["String"],"stringList":["String"],"pocoArray":[{"name":"String"}],"pocoList":[{"name":"String"}],"nullableByteArray":[0],"nullableByteList":[0],"nullableDateTimeArray":["\/Date(-62135596800000-0000)\/"],"nullableDateTimeList":["\/Date(-62135596800000-0000)\/"],"pocoLookup":{"String":[{"name":"String"}]},"pocoLookupMap":{"String":[{"String":{"name":"String"}}]},"mapList":{"String":["String"]}}