12 years ago
HTTP Builder support
Hello, I'm attempting to use HTTPBuilder ( http://groovy.codehaus.org/modules/http-builder/ ) from inside a groovy script step. I have added the http-builder-0.7-20130216.204411-3.jar file to bin\...
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-1.2.1.1.jar signpost-core-1.2.1.1.jar xml-resolver-1.2.jar
\nMaybe not all of them are necessary, let me know if some of them can be removed without harm.
\nThe script I used is the following:
\nimport groovyx.net.http.*\nimport static groovyx.net.http.ContentType.*\nimport static groovyx.net.http.Method.*\nimport org.apache.http.auth.*\n\ndef http = new HTTPBuilder( 'http://tch-testrail01/testrail/index.php?/api/v2/add_result/435517' )\nhttp.request( POST, JSON ){ req ->\nbody = [status_id:1, comment:'passed']\nheaders.'Content-Type' = 'application/json'\nheaders.'Authorization' = 'Basic ' + 'user:password'.bytes.encodeBase64().toString()\nresponse.success = { resp, json ->\nlog.info json\n}\n}","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"223","kudosSumWeight":0,"repliesCount":0,"postTime":"2018-07-19T06:55:46.658-07:00","lastPublishTime":"2018-07-19T06:55:46.658-07:00","metrics":{"__typename":"MessageMetrics","views":1666},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:soapui-os-community/community:nwkab66374board:SoapUI_OS/message:31207/message:168173","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}}}}},"page":"/forums/ForumMessagePage/ForumMessagePage","query":{"boardId":"soapui_os","messageSubject":"http-builder-support","messageId":"31207","replyId":"31211"},"buildId":"_FASV5DDw52YaqfBDLqsB","runtimeConfig":{"buildInformationVisible":false,"logLevelApp":"info","logLevelMetrics":"info","openTelemetryClientEnabled":false,"openTelemetryConfigName":"smartbear","openTelemetryServiceVersion":"24.11.0","openTelemetryUniverse":"prod","openTelemetryCollector":"http://localhost:4318","openTelemetryRouteChangeAllowedTime":"5000","apolloDevToolsEnabled":false},"isFallback":false,"isExperimentalCompile":false,"dynamicIds":["./components/seo/QAPageSchema/QAPageSchema.tsx","./components/community/Navbar/NavbarWidget.tsx","./components/community/Breadcrumb/BreadcrumbWidget.tsx","./components/messages/TopicWithThreadedReplyListWidget/TopicWithThreadedReplyListWidget.tsx","./components/messages/RelatedContentWidget/RelatedContentWidget.tsx","./components/messages/MessageListForNodeByRecentActivityWidget/MessageListForNodeByRecentActivityWidget.tsx","./components/customComponent/CustomComponent/CustomComponent.tsx","./components/messages/MessageView/MessageViewStandard/MessageViewStandard.tsx","../shared/client/components/common/List/UnstyledList/UnstyledList.tsx","./components/messages/MessageView/MessageView.tsx","./components/messages/MessageView/MessageViewInline/MessageViewInline.tsx","../shared/client/components/common/List/ListGroup/ListGroup.tsx","../shared/client/components/common/Pager/PagerLoadMore/PagerLoadMore.tsx"],"appGip":true,"scriptLoader":[]}