Forum Discussion

Rhonda_Ward's avatar
Rhonda_Ward
Occasional Contributor
13 years ago

Different ways to pass message body to the HTTP Post request

What are different ways to pass message body to the HTTP Post request.


I am looking to pass below multi part information to message body.
------------IsashgjauayjhaU77UI87HJHJHGGY1
Content-Disposition: form-data; name="Filename"

readme.txt
------------IsashgjauayjhaU77UI87HJHJHGGY1
Content-Disposition: form-data; name=""

MzZFY05rQXBWRCt4dnc9PQ
------------IsashgjauayjhaU77UI87HJHJHGGY1
Content-Disposition: form-data; name=""

from_email@fake.com
------------IsashgjauayjhaU77UI87HJHJHGGY1
Content-Disposition: form-data; name=""

to_email@fake.com
------------IsashgjauayjhaU77UI87HJHJHGGY1
Content-Disposition: form-data; name="fname"; filename="readme.txt"
Content-Type: application/octet-stream

new data
------------IsashgjauayjhaU77UI87HJHJHGGY1
Content-Disposition: form-data; name=""

Submit Query
------------IsashgjauayjhaU77UI87HJHJHGGY11--

1 Reply

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Rhona,

    sure... to send a request like this you need to:

    1) Create an HTTP Request Step
    2) Set the method to POST
    3) Set the "Media Type" of the content to multipart/form-data
    4) Check the "Post QueryString" checkbox
    5) Attach the file(s) you want to send in the Attachments tab at the bottom of the request window
    6) Add the desired parameters and their values; those parameters that should contain the contents of an attachment ("fname" in your example) should have the value "file:<name of attachment>", for example "file:readme.txt" if you attached a file named readme.txt

    Send the request and check in the Raw Request tab that it was sent as desired..

    Hope this helps,

    regards,

    /Ole
    SmartBear Sweden