readResponse
document is returned if no rows match criteria.
Method | GET | ||
Path | /res/{resName}/{resId} | ||
Query Params | None required (optionally use _output=application/json to specify JSON encoding)
|
||
Request body | None | ||
Response body | Results as XML | Response.xsd | Content-Type: application/xml or application/json |
readResponse
document is returned if no rows match criteria.
Results are ordered by the primary key(s), in ascending order. In a hierarchical query, the children are ordered within the parent by the child table's primary key(s).
GET /restsql/res/Actor/123 HTTP/1.1 Accept: applicaton/xml
HTTP/1.1 200 OK Content-Type: application/xml <readResponse> <actor actor_id="123" first_name="JULIANNE" last_name="DENCH" /> </readResponse>
GET /restsql/res/ActorFilm/123 HTTP/1.1 Accept: applicaton/xml
HTTP/1.1 200 OK Content-Type: application/xml <readResponse> <actor actor_id="123" first_name="JULIANNE" last_name="DENCH"> <film year="2600" title="ADAPTATION HOLES" film_id="3" /> <film year="2600" title="ATLANTIS CAUSE" film_id="43" /> <film year="2600" title="BERETS AGENT" film_id="67" /> <film year="2600" title="BULL SHAWSHANK" film_id="105" /> <film year="2600" title="CHOCOLATE DUCK" film_id="148" /> </actor> </readResponse>
GET /restsql/res/Actor/123 HTTP/1.1 Accept: applicaton/json
HTTP/1.1 200 OK Content-Type: application/json { "actors": [ { "id": 123, "first_name": "JULIANNE", "surname": "DENCH" } ] }
GET /restsql/res/ActorFilm/123 HTTP/1.1 Accept: applicaton/json
HTTP/1.1 200 OK Content-Type: application/json { "actors": [ { "id": 123, "first_name": "JULIANNE", "surname": "DENCH" }, "films": [ { "year": 2006, "title": "ADAPTATION HOLES", "film_id": 3 }, { "year": 2006, "title": "ATLANTIS CAUSE", "film_id": 43 }, { "year": 2006, "title": "BERETS AGENT", "film_id": 67 }, { "year": 2006, "title": "BULL SHAWSHANK", "film_id": 105 }, { "year": 2006, "title": "CHOCOLATE DUCK", "film_id": 138 }, ] } ] }
Without an Accept header, the output format defaults to application/xml. An alternative to the Accept header is using the
_output
query parameter with the mime type, as in:
GET /restsql/res/ActorFilm/123?_output=application/json HTTP/1.1