- I follow the example
upload.feature but Karate seems only allow multipart form request.
Scenario: Successul
* karate.log(token, auth, common_headers)
Given url 'https://webhook.site/e026040f-68ac-45e9-8add-c839fd46f0ba'
And multipart field image = read('images/img1.png')
And header Content-Type = 'image/png'
When method PUT
Then status 200
- This would probably translate to the follow
curl command (from Postman)
curl --location --request PUT 'https://staging-ah.naluri.net/food-journal/upload?x-pri-id=qedSdhZU7UmXXztqFJyJw&x-verify-id=P2KUBtR07Qqk3j6U7tGrG' \
--header 'Content-Type: image/png' \
--form 'file=@"/Users/dennis.dao/workspace/repo/sample/karate-ui-sample/images/img1.png"'
- This is what I would like to achieve the following
curl --location --request PUT 'https://staging-ah.naluri.net/food-journal/upload?x-pri-id=qedSdhZU7UmXXztqFJyJw&x-verify-id=P2KUBtR07Qqk3j6U7tGrG' \
--header 'Content-Type: image/png' \
--data '@images/img1.png'
I found the solution: