Forum Discussion
i want to test the rest services using soap Ui with groovy scripting.
i have the code for get method , like below sample
import com.eviware.soapui.model.iface.Submit
def uri = "http://jsonplaceholder.typicode.com/posts/1"
WsdlProject project = new WsdlProject()
RestServiceBuilder serviceBuilder = new RestServiceBuilder()
serviceBuilder.createRestService(project, uri)
println "service name: "+project.getInterfaceList()[0].name
println "Resource: "+project.getInterfaceList()[0].getOperationList()[0]
RestRequest request = project.getInterfaceList()[0].getOperationList()[0].getRequestList()[0]
Submit submit = (Submit) request.submit( new WsdlSubmitContext(), false );
Response response = submit.getResponse();
String responseContent = response.getContentAsString();
println( responseContent );
but i dont know how to start with Post Method with Json or xml attachement....
Still don't get it. Is the problem that you don't know how to attach a file to a request? Or is it that you don't know how to send a JSON/xml body?
- dsathishupm7 years agoOccasional Contributor
please tell me
how to attach a file to a request and how to send a JSON/xml body.
how to add headers (authorisation key, content type) on request body...
Related Content
- 2 years ago
- 4 years ago
- 4 years ago
Recent Discussions
- 15 years ago