1

I am trying to Automate API that has multipart upload. I am getting 415.

Scenario: 
  * def Json = {}
  * def multiPartText = read(Test.txt)
  * def multiPartPng = read(Test.png)
  * def multiPartJpg = read(Test.jpg)

When path 'Path'
And multipart field text = multiPartText
And multipart file jpg = { read: 'path/Test.jpg', filename: 'Test.jpg', content-Type: 'image/jpg'}
And header Content-Type = 'multipart/form-data'
And method POST
Then 201

this is what I written but I am getting 415.

Error:
  content-disposition: form data; name= "info"; filename=""
  content-type: text/plain
  content length: 500
  Completed: true
  IsinMemory: true


  Mixed content-disposition: from-data; name="file"; filename="Test.jpg"
  content-type: image/jpg
  content length: 500
  Completed: true
  IsinMemory: false >> Note: Path is correct and jpg in the framework.

Any one knows why? or How to solve it?

  • multipart is one of the hardest things to troubleshoot without having access to the live server. the only suggestion I have for you is read this: https://github.com/karatelabs/karate/issues/1645#issuecomment-862502881 – Peter Thomas Dec 22 '22 at 02:58

0 Answers0