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
0
votes
1 answer

Grails controller: how render image from byte array

I have byte array byteImg but I want render in my controller jpeg from byte array: def getSelfie = new HTTPBuilder() getSelfie.request(fullSelfieUrl, GET, JSON) { req -> headers.'X-DreamFactory-Session-Token' = session_id …
0
votes
1 answer

Grails HTTBuilder request Error

I make a request from Android to Grails controller. Request change the data in the database, but the Grails server returns an error: 2015-11-28 19:23:31,973 [http-bio-8080-exec-5] ERROR errors.GrailsExceptionResolver - MissingPropertyException…
0
votes
0 answers

groovy unknown host exception with REST client

The below code returns an exception even though the provided REST endpoint is up and valid. It is processed correctly as the DEBUG prompt shows the link of the GET request. It fails at the http.request line regardless of the REST endpoint provided.…
sizzle
  • 2,883
  • 2
  • 13
  • 10
0
votes
1 answer

Receiving partial results when parsing HTML with HttpBuilder

When I am parsing HTML with HttpBuilder like below, I am not receiving full HTML as I see when I go to that page and inspect. For example an tag is not seen in the file generated. @Grab(group='org.codehaus.groovy.modules.http-builder',…
user1207289
  • 3,060
  • 6
  • 30
  • 66
0
votes
1 answer

No signature of method: groovyx.net.http.HTTPBuilder.get() in intellij

I am trying to use groovy's HTTPBuilder. I'm getting: groovy.lang.MissingMethodException: No signature of method: groovyx.net.http.HTTPBuilder.get() is applicable for argument types: (groovyx.net.http.Method, groovyx.net.http.ContentType, …
Damon
  • 305
  • 1
  • 5
  • 13
0
votes
1 answer

Convert cookies from HTMLUnit to HTTPBuilder?

I am doing this (in Groovy): def cookies=webClient.cookieManager.cookies def http=new HTTPBuilder("myurl") http.request(POST) { def headersCookie='' cookies.eachWithIndex() { cookie,i-> if (i>0) { headersCookie+='; ' } …
Миша Кошелев
  • 1,483
  • 1
  • 24
  • 41
0
votes
1 answer

Groovy servlet can't find JAR files in Tomcat

I've created a groovlet that will act as a sort of HTTP proxy. It accepts GET requests and then makes web service calls based on the URL provided in the request. Here's the code I've got so…
Steve Nay
  • 2,819
  • 1
  • 30
  • 41
0
votes
2 answers

HTTP Builder/Groovy - get source text _and_ XmlSlurper output?

I am reading here: http://groovy.codehaus.org/modules/http-builder/doc/get.html I seem to be able to get i) XMLSlurper output as parsed by NekoHTML using: def http = new HTTPBuilder('http://www.google.com') def html = http.get( path : '/search',…
Миша Кошелев
  • 1,483
  • 1
  • 24
  • 41
0
votes
1 answer

SOAPUI: HTTPBuilder - unable to resolve class - exception

All, I am having an issue with the HTTPBuilder class in my Groovy script while trying to POST my request in XML format to a WSDL. What am I doing wrong? Below is my code: import groovyx.net.http.HTTPBuilder.* import static…
ssc
  • 35
  • 2
  • 9
0
votes
1 answer

Strange "new" property appearing after REST call using HTTPBuilder and Grails

I have a grails controller making a REST call using HTTPBuilder to a Spring backend: def getSettings(String customerID) { def http = new HTTPBuilder( grailsApplication.config.com.company.product.productWebserviceURL ) def result = [:] …
jcd
  • 221
  • 4
  • 15
0
votes
2 answers

http-builder in groovy uploading multiple files in server

I am trying to upload multiple files in a server using http builder-groovy.The below code doesn't works.Getting an error " Request entity is too large" .I have imported all the packages and defined all the variables. Is there any alternative for…
sailakshmi
  • 45
  • 1
  • 2
  • 6
0
votes
1 answer

How to PUT XmlSlurper back to REST with HttpBuilder

I'm trying to make GET and then PUT call on XML REST web service. I do it this way: @Grab('org.codehaus.groovy.modules.http-builder:http-builder:0.7') import groovyx.net.http.HTTPBuilder import static groovyx.net.http.ContentType.* import static…
0
votes
0 answers

@Grab with Eclipse

I'm trying the following @Grab from Eclipse @Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7' ) When i run it though, Eclipse just stops responding. This one…
devanon
  • 161
  • 1
  • 1
  • 12
0
votes
1 answer

HTTPBuilder Not Acceptable error

I am getting this error but my method looks perfectly fine to me def http = new HTTPBuilder() http.request( 'https://textalytics-topics-extraction-11.p.mashape.com/topics-1.2?txt=ben', Method.GET, ContentType.JSON ) { req -> …
Sagarmichael
  • 1,624
  • 7
  • 24
  • 53
0
votes
1 answer

sending post request to mailchimp 2.0 from grails

currently, I am integrating my grails project with mailchimp 2.0 API (we are currently use version 1.2 from grails-mailchimp plugin) When I send a post request with json data to mailchimp end point, I always receive this error "HTTP/1.1 302 Moved…
hakuna1811
  • 524
  • 5
  • 11