Forum Discussion

PeterPe's avatar
PeterPe
New Contributor
28 days ago

Soapui equivalent for curl -F (multipart/form-data)

I have a working curl command and want this to be integrated into soapui. The main problem is, that the api needs the binary file content in body (-F @curl). How can I achieve this?

curl -X POST -H "Authorization: Basic --snipped-base-64-encoded-string--"  -H "accept: */*" -H "Content-Type: multipart/form-data" -F file=@empty_pdf.pdf;type=application/pdf https://myapi.internal/api/scan

I've already tried via attachments (REST Test step Media type set to multipart/form-data and added the attachment (cached), but the api responds some error:

org.springframework.web.multipart.support.MissingServletRequestPartException: Required part 'file' is not present.

Thx in advance.

2 Replies

  • dale65a's avatar
    dale65a
    Occasional Visitor

    To integrate your `curl -F file=@...` command into SoapUI for binary file uploads, go to the **"Attachments" tab** of your REST Request. Add your file and, most importantly, in the **"Part" column** for that attachment, enter **`file`**. Ensure the "Type" is correct (`application/pdf`) and the request's "Content Type" is `multipart/form-data`. This explicitly names the file part as expected by your API, resolving the "Required part 'file' is not present" error.

    • PeterPe's avatar
      PeterPe
      New Contributor

      Thx for your reply, the "part" and "Type" fields in the grid are not editeable :/