All Verbs | /echo/complex |
---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;
public class dtos
{
public static class EchoComplexTypes
{
public SubType subType = null;
public ArrayList<SubType> subTypes = null;
public HashMap<String,SubType> subTypeMap = null;
public HashMap<String,String> stringMap = null;
public HashMap<Integer,String> intStringMap = null;
public SubType getSubType() { return subType; }
public EchoComplexTypes setSubType(SubType value) { this.subType = value; return this; }
public ArrayList<SubType> getSubTypes() { return subTypes; }
public EchoComplexTypes setSubTypes(ArrayList<SubType> value) { this.subTypes = value; return this; }
public HashMap<String,SubType> getSubTypeMap() { return subTypeMap; }
public EchoComplexTypes setSubTypeMap(HashMap<String,SubType> value) { this.subTypeMap = value; return this; }
public HashMap<String,String> getStringMap() { return stringMap; }
public EchoComplexTypes setStringMap(HashMap<String,String> value) { this.stringMap = value; return this; }
public HashMap<Integer,String> getIntStringMap() { return intStringMap; }
public EchoComplexTypes setIntStringMap(HashMap<Integer,String> value) { this.intStringMap = value; return this; }
}
public static class SubType
{
public Integer id = null;
public String name = null;
public Integer getId() { return id; }
public SubType setId(Integer value) { this.id = value; return this; }
public String getName() { return name; }
public SubType setName(String value) { this.name = value; return this; }
}
}
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
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: application/json
Content-Type: application/json
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: application/json 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"}}