All Verbs | /cached/customers |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Northwind.ServiceModel;
using Northwind.ServiceModel.Types;
namespace Northwind.ServiceModel
{
public partial class CachedGetAllCustomers
: IGet
{
}
[DataContract]
public partial class CustomersResponse
{
public CustomersResponse()
{
Results = new List<Customer>{};
}
[DataMember]
public virtual List<Customer> Results { get; set; }
[DataMember]
public virtual ResponseStatus ResponseStatus { get; set; }
}
}
namespace Northwind.ServiceModel.Types
{
[DataContract]
public partial class Customer
{
[DataMember]
public virtual string Id { get; set; }
[DataMember]
public virtual string CompanyName { get; set; }
[DataMember]
public virtual string ContactName { get; set; }
[DataMember]
public virtual string ContactTitle { get; set; }
[DataMember]
public virtual string Address { get; set; }
[DataMember]
public virtual string City { get; set; }
[DataMember]
public virtual string Region { get; set; }
[DataMember]
public virtual string PostalCode { get; set; }
[DataMember]
public virtual string Country { get; set; }
[DataMember]
public virtual string Phone { get; set; }
[DataMember]
public virtual string Fax { get; set; }
}
}
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 /cached/customers HTTP/1.1
Host: northwind.netcore.io
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{}
HTTP/1.1 200 OK Content-Type: text/jsonl 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"}}}