Test

<back to all web services

QueryItems

import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*


open class QueryItems : QueryDb<Item, Poco>()
{
}

open class QueryDb<From, Into> : QueryBase()
{
}

@DataContract
open class QueryBase
{
    @DataMember(Order=1)
    open var skip:Int? = null

    @DataMember(Order=2)
    open var take:Int? = null

    @DataMember(Order=3)
    open var orderBy:String? = null

    @DataMember(Order=4)
    open var orderByDesc:String? = null

    @DataMember(Order=5)
    open var include:String? = null

    @DataMember(Order=6)
    open var fields:String? = null

    @DataMember(Order=7)
    open var meta:HashMap<String,String> = HashMap<String,String>()
}

open class Item
{
    open var name:String? = null
    open var description:String? = null
}

open class Poco
{
    open var name:String? = null
}

@DataContract
open class QueryResponse<T>
{
    @DataMember(Order=1)
    open var offset:Int? = null

    @DataMember(Order=2)
    open var total:Int? = null

    @DataMember(Order=3)
    open var results:ArrayList<Poco> = ArrayList<Poco>()

    @DataMember(Order=4)
    open var meta:HashMap<String,String> = HashMap<String,String>()

    @DataMember(Order=5)
    open var responseStatus:ResponseStatus? = null
}

Kotlin QueryItems DTOs

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

HTTP + OTHER

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

POST /jsonl/reply/QueryItems HTTP/1.1 
Host: test.servicestack.net 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"skip":0,"take":0,"orderBy":"String","orderByDesc":"String","include":"String","fields":"String","meta":{"String":"String"}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"offset":0,"total":0,"results":[{"name":"String"}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}