Response Formats

Response Formats
This article includes information about response formats in 
Layer7 Live API Creator
In this article:
Demo Response Formats in the REST Lab
  1. With your API open, in the Tools section, click 
    REST Lab
    The Request tab displays by default.
    For more information about how to use the REST Lab, see Test Using the REST Lab.
  2. Select the 
    A section of parameters is revealed. The following image shows the 
     checkbox selected and the expanded section of parameters:
    Screen Shot 2016-12-02 at 10.53.39 PM.png
    For more information about how to view the filtering and ordering section of the page using the 
     checkbox, see GET.
  3. Choose a response format from the 
    Response Format
    • omit.
       Clears the selection and the default is used. 
    • json. 
      (Default) JSON is a ubiquitous format on the web and the default output of API Server. 
    • jsonObject.
       The object format for JSON changes the hierarchy of the data returned, putting the returned records in a nested "data" attribute.
    • xml.
       Restructures metadata into XML tag attributes.
    • csv.
       Comma-separated values (CSV), where each record is separated by a line end.  
      Layer7 Live API Creator
       flattens out the resources to the top-most level.
Globally Describe the Expected Response Format
You can set the expected response format globally across an API using the 
Default response format
For more information about this API property setting, see API Properties.
Override the API Default Response Format Settings
You can override the API default response format settings on a per-request basis by passing in an 
 HTTP Header or by defining the 
 URL variable. When conditionally requesting CSV formats, for example, an API user might define the request as:
HTTP Header
URL Variable
X-CALiveAPICreator-ResponseFormat: csv
You can have the header and URL variable defined, the priority from least to greatest, such as API default setting, HTTP header, and URL variable.
For more information about the HTTP headers that you can specify, see HTTP Headers.
Remove Metadata Attributes
You can remove the metadata attributes for CSV formats, or for XML formats, the 
 attribute for column values, using the 
 URL variable, for example: