GET | /genres | ||
---|---|---|---|
GET | /genres/{GenreId} |
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 QueryGenres : QueryDb<Genres>(), IGet
{
open var genreId:Long? = null
}
open class QueryDb<T> : 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>? = null
}
open class Genres
{
open var genreId:Long? = null
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<Todo>? = null
@DataMember(Order=4)
open var meta:HashMap<String,String>? = null
@DataMember(Order=5)
open var responseStatus:ResponseStatus? = null
}
open class Todo
{
open var id:Long? = null
open var text:String? = null
open var isFinished:Boolean? = null
}
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.
GET /genres HTTP/1.1 Host: blazor-gallery.servicestack.net Accept: application/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"offset":0,"total":0,"results":[{"genreId":0,"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"}}}