Forum Discussion

gspadmapriya's avatar
gspadmapriya
Occasional Visitor
7 years ago

How to post both image and json file in a REST request ?

I am not able to post both JSON and IMAGE file in one request, I set media type as Multipart/form-data and checked Post QueryString. But by default, it makes content-type of JSON file as text/javascript. And so the response is "Content type text/javascript is not supported". Please help

 

I am able to get Success response from POSTMAN. but not working here in SOAP UI Pro

1 Reply

  • nmrao's avatar
    nmrao
    Champion Level 3

    You mean to say that you need a dynamic request, media type and attachment?

    For setting dynamic request -
    https://community.smartbear.com/t5/SoapUI-NG/json-block-as-a-property-value/m-p/144532#M32717

    For setting dynamic attachment -
    There is a thread I was searching for this, could not find.

    You can use test case level custom properties and use Property expansion for the directory and filename in the attachment part.

    Similarly, use custom property for Content-type and use property expansion for the same.

     

    Refer here to know more about Property Expansion