Service Virtualization

  • 1.  REST Test Step (Delete method)

    Posted Feb 06, 2017 03:44 AM

    Is there anyway to allow for content on the REST Test step for delete methods? Currently this is disabled.



  • 2.  Re: REST Test Step (Delete method)

    Posted Feb 06, 2017 04:49 PM

    Same question - internet search indicates body in DELETE call is a bit of a gray area (rest - Is an entity body allowed for an HTTP DELETE request? - Stack Overflow ). i have a DELETE call Dev provided for testing that sends a body (able to do with Postman, but Content tab of REST step is disabled, causing the automation to fail)

     

    I guess Scripted Assertion + Beanshell is the next option...

       URL urlDeleteURL = new URL(DeleteURL);
       HttpURLConnection connDeleteURL = (HttpURLConnection) urlDeleteURL.openConnection();
       connDeleteURL.setRequestMethod("DELETE");



  • 3.  Re: REST Test Step (Delete method)
    Best Answer

    Posted Mar 04, 2017 02:11 PM

    We've had the same requirement and solved it using Custom Scripting step and Unirest java library (Unirest for Java - Simplified, lightweight HTTP Request Library) placed into hotDeploy directory.