Questions tagged [httpbuilder]

HTTPBuilder is a wrapper for Apache's HttpClient, with some (actually, a lot of) Groovy syntactical sugar thrown on top. The request/response model is also inspired by Prototype.js' Ajax.Request.

HTTPBuilder wraps Apache's HttpClient, with Groovy syntactical sugar thrown on top.

It handles common tasks such as building and parsing common content-types, handling common content-encodings, and built-in support for common authentication mechanisms. It works equally as well for simple REST-based requests, or ad-hoc web downloads.

The request/response model is inspired by Prototype.js's Ajax.Request.

206 questions
3
votes
1 answer

POST XML data with Groovy HTTPBuilder

I am trying to POST XML data to a URL using the HTTPBuilder class. At the moment I have: def http = new HTTPBuilder('http://m4m:aghae7eihuph@m4m.fetchapp.com/api/orders/create') http.request(POST, XML) { body = { element1 { …
Nico Huysamen
  • 10,217
  • 9
  • 62
  • 88
2
votes
1 answer

How to maintain session state between two request with Groovy HttpBuilder

I'm working on a integration test where authentication is needed. Session state (ie. cookie) seems not to be maintain beetween requests. Is there a CookieManager or something like that ? @Test public void…
Benoît Guérout
  • 1,977
  • 3
  • 21
  • 30
2
votes
1 answer

MissingMethodException in code based on tutorial and which worked yesterday

I have strange problem with Groovy and HttpBuilder library. First to note, I'm fresh to Groovy. I've based my code on tutorial. It simply loads the list of files from HTTP server. The code was working yesterday, today (after workspace build) not.…
Danubian Sailor
  • 1
  • 38
  • 145
  • 223
2
votes
0 answers

groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object on z/OS (Groovy - 2.4.12)

I am trying to run a RESTClient in Groovy to perform a HTTP PUT request usingthe below code, I am however facing the an issue def jsonObj = JsonOutput.toJson(version) println(jsonObj) def jsonObjtrim = jsonObj.trim() println("**** FIND 1ST CHAR…
bharath kumar
  • 21
  • 1
  • 3
2
votes
0 answers

GPathResult to org.w3c.dom.Node

This might be a very simple, but I'll ask anyway. I have the following code that does a post to a web service. I am using HttpBuilder to build the request and post the payload. The method returns a GPathResult that I need to change into a…
Espen Schulstad
  • 2,355
  • 3
  • 21
  • 32
2
votes
1 answer

Grails REST Client Plugin - PUT body content

Documentation seems to be lacking on both the plugin side as well as the HTTPBuilder side of things. I'm trying to submit some json through the put method, but it keeps telling me that put() doesn't like the map I am feeding it. Does anyone have an…
Gregg
  • 34,973
  • 19
  • 109
  • 214
2
votes
2 answers

Groovy's AsyncHTTPBuilder does not execute request asynchronously

I'm playing with AsyncHTTPBuilder (v0.5.1) however, I can't get it working so it's execute requests asynchronously. Please, check the code below. Looks like all requests are done from the same thread: @Test public void testPoolsizeAndQueueing()…
Archer
  • 5,073
  • 8
  • 50
  • 96
2
votes
1 answer

Groovy, java.lang.LinkageError problem with Executors and HttPBuilder

i have this test code: @Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.1' ) import java.util.concurrent.ExecutorService import java.util.concurrent.Executors import…
res1
  • 3,482
  • 5
  • 29
  • 50
2
votes
1 answer

Can't use ignoreSSLIssues in HttpBuilder version 0.7.1

Java 8 | Groovy Language | IDE: IntelliJ IDEA | Gradle 3 I have problem with SSL issue Code: import groovyx.net.http.RESTClient def client = new RESTClient() client.ignoreSSLIssues() def result = client.get(uri:…
Long Nguyen
  • 9,898
  • 5
  • 53
  • 52
2
votes
0 answers

Valid SSL Certificate but groovy is giving: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

I have already tried using http.ignoreSSLIssues() to make the script ignore the problem. I have already tried importing the certificate into a trusted keystore and then using that keystore to create a new SSLSocketFactory as instructed by the…
Kenny Wyland
  • 20,844
  • 26
  • 117
  • 229
2
votes
1 answer

Groovy jenkins Grab ERROR

I am trying to run a groovy script on Jenkins. I use the "Execute system groovy script". My script needs to use REST, thus I need the http-builder. Here is how I try to get it: @Grab(group='org.codehaus.groovy.modules.http-builder',…
Brunisboy
  • 123
  • 1
  • 19
2
votes
1 answer

Test jsonp rest app response using httpbuilder

Hi I'm trying to build up a rest Service which provide JSON response. Yesterday i figured about what is JSONP, why to use it an so and so. Today i would like to make some test with my new version of my service. To test it, i use HTTPbuilder. But i…
benzen
  • 6,204
  • 4
  • 25
  • 37
2
votes
1 answer

Groovy HTTPBuilder get last modified datetime

I am trying to fetch some files from internet. I want to update my schedule service if the last modified time update. With HTTPBuilder I am unable to find the server response with last-modified parameter. Is there any way to get this parameter?
Cool Java guy מוחמד
  • 1,687
  • 4
  • 24
  • 40
2
votes
1 answer

How to specify content type in request in groovy?

i'm trying to use the groovy httpbuilder to make a post to the microsoft exchange webservice (EWS). My problem is, I'm unable to set the proper request content-type. The library seems to have its own mind here. Does anyone have an idea? Cheers, …
ZeissS
  • 11,867
  • 4
  • 35
  • 50
2
votes
1 answer

Getting a "call(Unknown Source)" from a Jenkins system Groovy Script

I'm using the following script to do a Rest call. I have it working on another Jenkins rig and am now improving the script to make it reusable on another rig, but I'm getting an exception thrown. The code I'm having an issue with is the following.…
Joel
  • 111
  • 13