Inspecting responses - Cloud

Talend Cloud API Tester User Guide

EnrichVersion
Cloud
EnrichProdName
Talend Cloud
EnrichPlatform
Talend API Tester
task
Design and Development > Testing APIs
Inspect the response displayed by Talend Cloud API Tester.

Talend Cloud API Tester provides a dedicated area to display the response. This area maps the different elements of a response.

Status code and message

The status code and message indicate the status of the response. The status code is a normalized number. HTTP defines different families at this level: 2xx for success, 3xx for redirection, 4xx for client errors and 5xx for server errors.

For more information on status codes, see Response status codes.

Headers

The list of HTTP headers of the response is available under two formats: the default one is the pretty mode where all headers are listed in a tabular form with readable alignment of both names and values. The second mode is raw where all headers are displayed as they are received. This format is much more compact and could be less readable.

Talend Cloud API Tester understands a list of response headers and provides useful actions when you click them. See the table below for a complete list.

Response header Action
Location The URL of the current request is replaced by the header's value.
x-xrds-location The URL of the current request is set with the header's value.
Set-Cookie A new Cookie header is added to the request with the header's value.
Etag A new If-None-Match header is added to the request with the header's value (for more information, see Conditional Requests).
Last-Modified A new If-Modified-Since header is added to the request with the header's value (for more information, see Conditional Requests).
Expires A new If-Modified-Since header is added to the request with the header's value (for more information, see Conditional Requests).
Cache-Control If the value is a max-age or a s-max-age cache control directive, then a new header Cache-Control is added to the request with value max-age=0.
Allow These headers contain a list of clickable HTTP methods. Once clicked, the method of the current request is updated.
Access-Control-Allow-Methods These headers contain a list of clickable HTTP methods. Once clicked, the method of the current request is updated.

Response payload

The response payload is the data received. In order to ease readability, payloads can be displayed as they are (raw mode) or hex-encoded (hex mode). Some payloads can be also formatted using syntax coloration and other options (pretty mode) or in a preview mode:

  • raw displays the bytes of the payloads. It may produce unwanted effects when applied on "binary" payloads.
  • hex displays each byte of the payload in their hexadecimal representation.
  • preview fits very well with images, HTML payloads, etc. The browser is asked to render the payload according to its media type. Binary files are not rendered.
  • pretty supports various options such as syntax coloration. They are specified in the table below.

The raw and hex modes are available for all kinds of payloads. The preview mode is available for the HTML payloads, images and Binary. In the latter case, it simply displays a message saying that binary files cannot be previewed.

Here are the options available in the pretty mode:

Payload type Syntax coloration Line numbers Expand/collapse nodes Clickable URLs
XML yes yes yes yes
JSON yes yes yes yes
HTML yes no no yes

In API Tester Settings > APPEARANCE, you can configure response view options for each content type.

You can see the elapsed time of the request in the top right and the length of the body in the bottom right of the Response section.

Complete request headers

This section shows the headers that are typically managed by the browser, and what values have been sent. With Talend Cloud API Tester, you can let the browser manage these headers for you or you can choose to take control of it.

Browser behavior

Chrome browser adds additional headers to your HTTP requests if they are not provided, such as:

  • User-Agent
  • Accept, Accept-Encoding, Accept-Language
  • Cookie

The headers actually sent are displayed in the Complete request headers part of the response.

You can click the values to define them as part of your request. You can overwrite them if needed.

If you are automating your API tests, it is recommended to explicitly override headers that are relevant for your API, so that the behavior will be reproducible with the automation tool.

Cookies

Talend Cloud API Tester uses Google Chrome's Cookies management.

If Google Chrome has stored a cookie related to a particular domain, this cookie will be added to the request you send with Talend Cloud API Tester to that domain.

If you do not want cookies to be added in a request, simply define a Cookie header with an empty value to override this behavior.

Request edition helpers

In pretty mode, when possible, the URLs are parsed and emphasized. When you click on the link, the request is updated:

  • The URL field of the current request is updated with the value of the link (relative links are computed against the current request's URL).
  • The method of the current request is set to GET.

This is useful if you want to browse your API in the same way you browse the internet: by following links on pages. If you first request your API to get a contact and if the body contains links to the contact's address, you can quickly get the representation of the related address in two clicks:

  1. Click on the link to refresh the current request.
  2. Send the new request.

Additional actions

  • 2Request: copies the response payload into the payload of the request. If the request does not support payload (for example GET) then the method is automatically updated to POST.
  • Copy: copies the response payload into the clipboard; JSON or XML payloads are indented.
  • Download: downloads the response payload on local drive.

Request preview/response

You can preview the request you set up and get the whole response as raw text in the HTTP tab, in the bottom pane.