| GET | /search | ||
|---|---|---|---|
| GET | /{Ver}/search |
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@DataContract
public static class Search
{
@DataMember
public String q = null;
@DataMember
public UUID tokenId = null;
@DataMember
public Integer ver = null;
public String getQ() { return q; }
public Search setQ(String value) { this.q = value; return this; }
public UUID getTokenId() { return tokenId; }
public Search setTokenId(UUID value) { this.tokenId = value; return this; }
public Integer getVer() { return ver; }
public Search setVer(Integer value) { this.ver = value; return this; }
}
@DataContract
public static class SearchResponse implements IResponse
{
@DataMember
public ResponseStatus responseStatus = null;
@DataMember
public ArrayList<ProductModel> result = null;
public ResponseStatus getResponseStatus() { return responseStatus; }
public SearchResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
public ArrayList<ProductModel> getResult() { return result; }
public SearchResponse setResult(ArrayList<ProductModel> value) { this.result = value; return this; }
}
@DataContract
public static class ProductModel
{
@DataMember
public UUID id = null;
@DataMember
public String manufacturerTitle = null;
@DataMember
public String number = null;
@DataMember
public String title = null;
public UUID getId() { return id; }
public ProductModel setId(UUID value) { this.id = value; return this; }
public String getManufacturerTitle() { return manufacturerTitle; }
public ProductModel setManufacturerTitle(String value) { this.manufacturerTitle = value; return this; }
public String getNumber() { return number; }
public ProductModel setNumber(String value) { this.number = value; return this; }
public String getTitle() { return title; }
public ProductModel setTitle(String value) { this.title = value; return this; }
}
}
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 /search HTTP/1.1 Host: api.oszz.ru Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"result":[{"id":"00000000000000000000000000000000","manufacturerTitle":"String","number":"String","title":"String"}]}