All Verbs | /customers |
---|
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
open class GetAllCustomers : IGet
{
}
@DataContract
open class CustomersResponse
{
@DataMember
open var results:ArrayList<Customer> = ArrayList<Customer>()
@DataMember
open var responseStatus:ResponseStatus? = null
}
@DataContract
open class Customer
{
@DataMember
open var id:String? = null
@DataMember
open var companyName:String? = null
@DataMember
open var contactName:String? = null
@DataMember
open var contactTitle:String? = null
@DataMember
open var address:String? = null
@DataMember
open var city:String? = null
@DataMember
open var region:String? = null
@DataMember
open var postalCode:String? = null
@DataMember
open var country:String? = null
@DataMember
open var phone:String? = null
@DataMember
open var fax:String? = null
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /customers HTTP/1.1
Host: northwind.netcore.io
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { results: [ { id: String, companyName: String, contactName: String, contactTitle: String, address: String, city: String, region: String, postalCode: String, country: String, phone: String, fax: String } ], responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } } }