All Verbs | /customers |
---|
// @DataContract
export class Customer
{
// @DataMember
public id: string;
// @DataMember
public companyName: string;
// @DataMember
public contactName: string;
// @DataMember
public contactTitle: string;
// @DataMember
public address: string;
// @DataMember
public city: string;
// @DataMember
public region: string;
// @DataMember
public postalCode: string;
// @DataMember
public country: string;
// @DataMember
public phone: string;
// @DataMember
public fax: string;
public constructor(init?: Partial<Customer>) { (Object as any).assign(this, init); }
}
// @DataContract
export class CustomersResponse
{
// @DataMember
public results: Customer[];
// @DataMember
public responseStatus: ResponseStatus;
public constructor(init?: Partial<CustomersResponse>) { (Object as any).assign(this, init); }
}
export class GetAllCustomers implements IGet
{
public constructor(init?: Partial<GetAllCustomers>) { (Object as any).assign(this, init); }
}
TypeScript GetAllCustomers DTOs
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"}}}