Forum Discussion

gaurav090187's avatar
gaurav090187
New Contributor
5 years ago

How to pass multipart/form-data request schema in POST Request?

  • I have the below request schema which I want to send as form-data while sending POST request in SOAPUI PRO. Can any one please help me out on how to handle this?
  • "FORM991"
  • "null"
  • "null"
  • "null"
  • "477249b2-c312-4e7f-8f52-7ad7bc32da0f"
  • "null"
  • "c1e12f6d-b710-4d9e-a97d-48774d42c824"
  • "online"
  • "false"
  • "ABBI991"
  • "ACC9991"
  • "TEST991"
  • Hi gaurav090187 

     

    I had to use the multipart/form-data type a while back and it caused me so many problems - however - this is the answer that @Nastya_Khovrina came back with - (i think part of the problem is its an old way of doing things) essentially build the form content as query parms rather than add the payload attributes and values in to the payload section of the request form.  I managed to get it working only once when I tried populating the payload field.

     

    Anyway - Anastacia's approach was as below:

     

    You can do the following:

    1. Specify your properties as query parameters of a request.

    2. Check the Post QueryString option.

    3. Don't forget to clear the Request form (below the Media Type dropdown)

    Please see the screenshot:

    ReadyAPI_2019-07-01_13-30-12.png

     

    Here is what you'll get as a result:

     

    ReadyAPI_2019-07-01_13-30-33.png

     

    Also, here are some useful resources:

    LearnUpon: https://smartbearacademy.learnupon.com/enrollments/25031374

    YouTube: https://www.youtube.com/watch?v=iL-zehJmtWw&list=PLrA5ciulugn_w0pW1_SSyfucD-k5Fasj_&index=5

     

    Cheers,

     

    rich

2 Replies

  • richie's avatar
    richie
    Community Hero

    Hi gaurav090187 

     

    I had to use the multipart/form-data type a while back and it caused me so many problems - however - this is the answer that @Nastya_Khovrina came back with - (i think part of the problem is its an old way of doing things) essentially build the form content as query parms rather than add the payload attributes and values in to the payload section of the request form.  I managed to get it working only once when I tried populating the payload field.

     

    Anyway - Anastacia's approach was as below:

     

    You can do the following:

    1. Specify your properties as query parameters of a request.

    2. Check the Post QueryString option.

    3. Don't forget to clear the Request form (below the Media Type dropdown)

    Please see the screenshot:

    ReadyAPI_2019-07-01_13-30-12.png

     

    Here is what you'll get as a result:

     

    ReadyAPI_2019-07-01_13-30-33.png

     

    Also, here are some useful resources:

    LearnUpon: https://smartbearacademy.learnupon.com/enrollments/25031374

    YouTube: https://www.youtube.com/watch?v=iL-zehJmtWw&list=PLrA5ciulugn_w0pW1_SSyfucD-k5Fasj_&index=5

     

    Cheers,

     

    rich