pkinoc
12 years agoOccasional Contributor
[Resolved] Multipart question
I have some Java code to do loadtesting of a REST service and I'd like to convert some of it to Soapui for functional testing. The request includes sending some multipart data as a byte array once the connection is open but I'm not sure where to do this in soapui.
The snippet of code below sends the request using Java by writing it to the output stream.
connection = (HttpURLConnection) serverAddress.openConnection();
connection.setRequestMethod("POST");
connection.setDoOutput(true);
connection.setRequestProperty("Connection", "Keep-Alive");
connection.setAllowUserInteraction(true);
connection.setDoInput(true);
connection.connect();
wr = connection.getOutputStream();
byte[] byteData = TestMultipart.getMultipartContent();
wr.write(byteData);
wr.flush();
Now, I converted the Java code to Groovy to create the byte array. The question is, where do I add this to the request?
Thanks,
Peter
The snippet of code below sends the request using Java by writing it to the output stream.
connection = (HttpURLConnection) serverAddress.openConnection();
connection.setRequestMethod("POST");
connection.setDoOutput(true);
connection.setRequestProperty("Connection", "Keep-Alive");
connection.setAllowUserInteraction(true);
connection.setDoInput(true);
connection.connect();
wr = connection.getOutputStream();
byte[] byteData = TestMultipart.getMultipartContent();
wr.write(byteData);
wr.flush();
Now, I converted the Java code to Groovy to create the byte array. The question is, where do I add this to the request?
Thanks,
Peter