Forum Discussion

patrickOfTelven's avatar
12 years ago

HTTP Builder support


I'm attempting to use HTTPBuilder ( ) from inside a groovy script step.
I have added the http-builder-0.7-20130216.204411-3.jar file to bin\ext but when I run one of the sample scripts I receive this error.
Anyone have any ideas? I've used this library before outside of SoapUI and didn't have this problem.

The end goal is to use the script to login and generate the authentication cookie that I can then use for my tests...


2 Replies

  • pford90's avatar
    Occasional Contributor

    I am in a similar situation, by any chance did you figure out how to send request from your groovy script.
    • lhimo's avatar
      New Contributor

      I managed to send a http request through groovy script in SoapUI 5.4.0, bu putting the following jars in the lib folder: http-builder-0.6.jar antlr-2.7.7.jar appengine-api-1.0-sdk-1.3.8.jar asm-3.2.jar asm-analysis-3.2.jar asm-commons-3.2.jar asm-tree-3.2.jar asm-util-3.2.jar ezmorph-1.0.6.jar signpost-commonshttp4- signpost-core- xml-resolver-1.2.jar

      Maybe not all of them are necessary, let me know if some of them can be removed without harm.

      The script I used is the following:

      import static*
      import static*
      import org.apache.http.auth.*
      def http = new HTTPBuilder( 'http://tch-testrail01/testrail/index.php?/api/v2/add_result/435517' )
      http.request( POST, JSON ){ req ->
      body = [status_id:1, comment:'passed']
      headers.'Content-Type' = 'application/json'
      headers.'Authorization' = 'Basic ' + 'user:password'.bytes.encodeBase64().toString()
      response.success = { resp, json -> json