We often need to save the content of an HTTP response to a file, for example, if we want to parse it later.
To save response to a file, enter the name of the file in the Response File Name
field when configuring the HTTP Connection. For example: {app.data}/response.json
. This will create the actual file in the home folder, and the name of the file will be response_uuid.json
. You can use token {app.data}
as a part of the response file name. {app.data}
is the home folder.
You can also use the token {destination}
as part of the Response File Name
. The {destination}
token will be automatically replaced for the value provided in the TO
field of the file management operation or source to destination transformation.
For example:
- Response File Name:
{app.data}/response/{destination}
- TO:
replace(_processing.xml, _response.json)
- Source file:
order_processing.xml
The response file will be created in the home folder and will have the name order_response.json
.
you can configure an HTTP Connection to create a response file only if the HTTP request was executed with an error. Just enable the option Save Response only on Error
.
Comments
0 comments
Please sign in to leave a comment.