2

I am sending a request with a custom accept header of application/content.bundle.v1+zip

The REST service promptly responds;

HTTP/1.1 200 OK
content-type: application/content.bundle.v1+zip
connection: keep-alive
content-encoding: gzip
transfer-encoding: chunked

Because of the unrecognized content-type SOAPUI providing me the zip file as a RAW sting of Data. Is it possible to change the content-type of the response so that SOAPUI interprets it as a standard application/zip which in turn it would treat as an attachment?

  • As an alternative is it possible to add additional content-types to SoapUI? – ECiurleo Dec 7 '15 at 10:26
2
+50

Using this tip/trick you can modify the response's header. The example shows modifying the content but you should be able to get the gist.

if( request.response == null )
return

// get response content
def content = context.httpResponse.responseContent

// manipulate content
content = content.replaceAll( "555", "444" )

// write it back
context.httpResponse.responseContent = content
  • This has worked for me, just doing a like for like replacement to a default format. – ECiurleo Dec 9 '15 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.