1

I'm pretty new in karate so, I need your help. I have .feature file. We have API which should return .zip file with commits data

    Given path EndpointUrl + 'request-commit/{param1}/{param2}'
    When method GET
    Then status 200
    And def responsebytes = responsebytes

Overall scrip works fine because in Content-disposition i do see attachment ".zip" file

In case when I use

curl -k link --request GET -H 'content-type: application/json' -H 'client_id: 12344' -H 'accept: application/json' -O -J 

from remote_host I can download .zip file

But how to get zip into a local dir after the script execution? How to use the proper flags -O and -J from curl call in karate? Could you please help me to resolve this question?

Thank you!

1 Answers1

0

This should save a file to target/foo.zip: https://stackoverflow.com/a/54593057/143475

* karate.write(responseBytes, 'foo.zip')

Also you may find this interesting: https://stackoverflow.com/a/64352676/143475

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248