You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Requests

Most services respond to the HTTP method GET while certain others respond to both GET and POST. The applicable methods per service are described under each service group. Either protocol, HTTP or HTTPs are acceptable.

Responses

The response serialization for each service is dictated by the request 'content-type' HTTP header (Accept). The following table lists the possible return formats. Each format will be described in the response section of the respective service method.

 

Request Content-Type

Serialization

application/json

JSON

text/xml

XML

text/html

XHTML currently unused but may be supported in the future

 

CDWS determines the serialization method of the output in the following order:

  1. HTTP header: content-type
  2. Query parameter content-type
  3. Pre-defined default per service (usually JSON)

Typically, clients will have their own method of setting request HTTP headers.

The following examples use the UNIX wget command line utility

Example 1: setting the request header field

wget -O- \
  --header 'x-user: x' \
  --header 'x-password: y' \
  --header="Content-Type:text/xml"
'http://cdws.ificlaims.com/search/query?q=pn:ep-0700000-b1'

 

Example 2: setting the content-type as a query-string parameter

wget -O- \
  --header 'x-user: x' \
  --header 'x-password: y' \
'http://cdws.ificlaims.com/search/query?q=solr&content-type=text/xml'

 


CDWS currently supports JSON (typically the default) and XML. The only exception is the attachment service method fetch which returns HTTP 302 (redirect). Following the redirect returns the media type of the specific attachment being requested, e.g., application/tif, application/pdf etc. Specifying any content type other than text/xml or application/json will lead to an HTTP 415 (Not Implemented) response.

Although the serialization is predetermined by the request content-type, the response format for each service group differs. The response formats will be described under their respective service groups.

  • No labels