Test Service Connection Responses

You can configure a POST/PATCH/PUT REST API with application/octet-stream or multipart/form-data format and test it from the service connection's endpoint's Test tab before proceeding with it. You can also use the form-data's schema when you call the REST endpoint.

You can access this functionality from two places, where you can use radio buttons to select the payload type to test:

  • From the Body tab under the Endpoint editor's Request tab:
    Screen shot showing payload selection options from the Body tab under the Endpoint editor's Request tab
  • From the Body panel under the Test tab:
    Screen shot showing payload selection options from the Body panel under the Test tab

In both screenshots, the Text payload option is selected. The body input area beneath the radio buttons looks and operates the same way it has in all prior releases.

Test Responses Using the Form Data Option

When you select the Form-Data payload option, the Media Type is automatically changed to multipart/form-data and you're presented with a form for defining input elements that provide the data values in a multipart request body:


Screenshot showing the Form-Data payload option selected, the Media Type set to multipart/form-data, and an open form for defining input elements for data values

Two types of input elements can be created:

  • String, for providing a user-entered text value.
  • File, for selectiing a file to provide a binary data value.

As elements are added to the form, corresponding properties will be added to the media type's schema in the OpenAPI metadata:
Screenshot showing String and File elements being added to the input form

When the request is submitted from the Test tab, the names and values of the inputs are used to generate a FormData object that defines the multipart payload.

When form elements are created and displayed in the Request tab, the input elements themselves (that is, the text field or file picker) aren't rendered, because testing and submitting the form data can't be performed in this context:
Screenshot showing the jasonInputParameters (String) and primaryFile (File) form elements that were created

Test Responses Using the Binary Option

When you select the Binary payload option, the media type defaults to application/octet-stream, although you could manually enter any binary content type you want:
Screenshot showing binary payload selected with the default media stream type of application/octet-stream

After you click the Create Binary-Compatible Schema button, the corresponding schema will be generated.

After the schema has been created, you can use the file picker to select the file that'll be used as binary payload when the request is submitted:
Screenshot showing the picker used to select the binary file for the payload

The file picker for the Binary payload type isn't shown in the Request tab:
Screenshot showing the message indicating that the schema was created

Instead, a message indicates that the schema has been created.

Service endpoints support downloading binary or text responses in the endpoint's Test tab. You can use the Download button to save the response body. If the response is non-text, you'll see a message that tells you that the response body contains binary data:
Screenshot showing the endpoint's Test tab with the Download button for saving the binary response.

You can also use the Download button to download or save text responses:
Screenshot showing the endpoint's Test tab with the Download button for saving the response's text payload.