export class Poco
{
public name: string;
public constructor(init?: Partial<Poco>) { (Object as any).assign(this, init); }
}
export class TestUploadWithDto implements IPost
{
public int: number;
public nullableId?: number;
public long: number;
public double: number;
public string: string;
public dateTime: string;
public intArray?: number[];
public intList?: number[];
public stringArray?: string[];
public stringList?: string[];
public pocoArray?: Poco[];
public pocoList?: Poco[];
public nullableByteArray?: number[];
public nullableByteList?: number[];
public nullableDateTimeArray?: string[];
public nullableDateTimeList?: string[];
public pocoLookup?: { [index:string]: Poco[]; };
public pocoLookupMap?: { [index:string]: { [index:string]: Poco; }[]; };
public mapList?: { [index:string]: string[]; };
public constructor(init?: Partial<TestUploadWithDto>) { (Object as any).assign(this, init); }
}
TypeScript TestUploadWithDto DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /csv/reply/TestUploadWithDto HTTP/1.1
Host: test.servicestack.net
Accept: text/csv
Content-Type: text/csv
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: text/csv 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"]}}