All Verbs | /customers |
---|
namespace Northwind.ServiceModel
open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<DataContract>]
[<AllowNullLiteral>]
type Customer() =
[<DataMember>]
member val Id:String = null with get,set
[<DataMember>]
member val CompanyName:String = null with get,set
[<DataMember>]
member val ContactName:String = null with get,set
[<DataMember>]
member val ContactTitle:String = null with get,set
[<DataMember>]
member val Address:String = null with get,set
[<DataMember>]
member val City:String = null with get,set
[<DataMember>]
member val Region:String = null with get,set
[<DataMember>]
member val PostalCode:String = null with get,set
[<DataMember>]
member val Country:String = null with get,set
[<DataMember>]
member val Phone:String = null with get,set
[<DataMember>]
member val Fax:String = null with get,set
[<DataContract>]
[<AllowNullLiteral>]
type CustomersResponse() =
[<DataMember>]
member val Results:ResizeArray<Customer> = null with get,set
[<DataMember>]
member val ResponseStatus:ResponseStatus = null with get,set
[<AllowNullLiteral>]
type GetAllCustomers() =
interface IGet
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
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/x-vcard
Content-Type: text/x-vcard
Content-Length: length
{}
HTTP/1.1 200 OK Content-Type: text/x-vcard 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"}}}