Hi all,
I have to extract a zip file from an API response.
The description of the response is :
I have an HTTP SENDER (GET Method) and I receive a correct response with status 2xx.
In the 'Response Transformer', I get the response with : "var myReponse = response.getMessage();"
My (big) problem is : how could I extract the base64 data from my response ?
The responseHeader is :
Thank's.
I have to extract a zip file from an API response.
The description of the response is :
The format of the HTTP response body is as follow if the status code is 2xx.
i. Part 1 - header
1. A Content-type header is “application/zip;charset=UTF-8”.
2. A Content-disposition header that includes a patient ID and the exact setup time of the corresponding measurement and the format of the corresponded file name is
“{PatientID}_{YYYYMMDDHHmm}_{reportTypeName}.zip”;
an example is as below:
attachment; filename="P001_201804270937_cardiac.zip";
filename*=utf-8''P001_201804270937.zip
i. Part 2 - A report file was encoded Base64 format (my zip file).
i. Part 1 - header
1. A Content-type header is “application/zip;charset=UTF-8”.
2. A Content-disposition header that includes a patient ID and the exact setup time of the corresponding measurement and the format of the corresponded file name is
“{PatientID}_{YYYYMMDDHHmm}_{reportTypeName}.zip”;
an example is as below:
attachment; filename="P001_201804270937_cardiac.zip";
filename*=utf-8''P001_201804270937.zip
i. Part 2 - A report file was encoded Base64 format (my zip file).
I have an HTTP SENDER (GET Method) and I receive a correct response with status 2xx.
In the 'Response Transformer', I get the response with : "var myReponse = response.getMessage();"
My (big) problem is : how could I extract the base64 data from my response ?
The responseHeader is :
{vary=[Accept-Encoding],
connection=[keep-alive],
transfer-encoding=[chunked],
content-type=[application/json;charset=UTF-8],
date=[Tue, 26 Jul 2022 09:19:48 GMT],
keep-alive=[timeout=120],
content-disposition=
[attachment; filename="16679585_202204251357-cardiac.zip"; filename*=utf-8''16679585_202204251357-cardiac.zip],
cache-control=[no-store],
server=[nginx]}
How can I separate Header from Body of my response ? Any idee ?connection=[keep-alive],
transfer-encoding=[chunked],
content-type=[application/json;charset=UTF-8],
date=[Tue, 26 Jul 2022 09:19:48 GMT],
keep-alive=[timeout=120],
content-disposition=
[attachment; filename="16679585_202204251357-cardiac.zip"; filename*=utf-8''16679585_202204251357-cardiac.zip],
cache-control=[no-store],
server=[nginx]}
Thank's.

Comment