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
2 answers

How can I execute a simple request with an URL in Groovy/Java?

I have the following code in groovy: def http = new HTTPBuilder( 'http://localhost:8080' ) http.post( path: '/this/is/my/path/'+variable) { resp -> println "POST Success: ${resp.statusLine}" assert resp.statusLine.statusCode == 200 } I only…
Pablo Glez
  • 306
  • 1
  • 7
  • 20
0
votes
1 answer

Groovy HttpBuilder - Don't send negotiate authorization

I'm having problem connect with s so (shibboleth to be specific) . I'm using HTTP Builder on groovy and once i Get 401 i need to send Authorization Negotiate, but It just don't send! I tried to define the header manually or with the HTTP builder…
0
votes
0 answers

HttpBuilder accessing secured link https

I am using this code for GETting a JSON object from the URL using Groovy: the URL that I use is a HTTPS URL so when I test the code I get a 403 error, after Google it I understand that I need to use a HttpBuilder SSL but I don't understand how can I…
user2936743
  • 61
  • 5
  • 13
0
votes
2 answers

Array GET all data and add page number at end

I have the following code. I want the code to get all of the data from the current url which is like search.php?q=dvd+player&attr=23903940_portable_dvd_player&attr=23903945_cd&attr=23903935_mpeg_4 Code: 1) { …
0
votes
1 answer

building async httpbuilder similar to httpbuilder

Might be the wrong place to post this but I have been messing around with async http builders trying to get basic cypher queries to work. It works with Http Builders but can't get it to work with the async version. …
Badmiral
  • 1,549
  • 3
  • 35
  • 74
0
votes
1 answer

HTTPBuilder, returning JSON in not the correct format

I have a service that I am built\using returning data in the below format. def responseData = [ 'results': results, 'status': results ? "OK" : "Nothing present" ] render(responseData as JSON) The output looks like this, I have verified the output…
user2498465
  • 77
  • 10
0
votes
1 answer

Return value from HTTPResponse closure Grails HTTPBuilder to outer method

I have some code like this def lookupTickets() { User currentUser = webAuthService.currentUser() def http = new HTTPBuilder(zdURL) http.auth.basic("${zdUser}/token", zdApiKey) http.get(path: "/api/v2/users/search.json", …
benstpierre
  • 32,833
  • 51
  • 177
  • 288
0
votes
1 answer

Grails HTTPBuilder not working with variable in body

I am writing a code in grails which is making a post call using httpbuilder. everything works fine if I hardcode the values for body but when I pass the same using variables, then it keep giving me - Unprocessable Entity. Stacktrace…
saurabh
  • 2,389
  • 3
  • 22
  • 37
0
votes
2 answers

Creating soap request with http build

Im trying to make a soap request using httpbuilder. I need to pass some authentication parameters in the head section. My code is as follows def String WSDL_URL = 'http://ws.tradetracker.com/soap/affiliate?wsdl' def http = new HTTPBuilder(…
user1485182
  • 41
  • 1
  • 1
  • 11
0
votes
1 answer

What is available in the withRest closure?

The REST Client of HTTP Builder has a withRest closure. How can I tell what is available in this closure: withRest(uri: domainName) { what,parameters,are,available,here -> } The source is here (line 80 seems like a good place to start).
zoran119
  • 10,657
  • 12
  • 46
  • 88
0
votes
1 answer

Consuming web service

I'm calling a web service like this (using rest plugin): withRest(uri: "http://server.com") { def response = post(path: '/webservice', query: [q: 'test']) // process response } and getting the following response:
zoran119
  • 10,657
  • 12
  • 46
  • 88
0
votes
2 answers

Grails REST plugin using HTTPBuilder for HTTPS

I have a service method in grails that was working fine. It pulls a JSON via a GET request. After moving to prod we had to change the protocol to HTTPS and now I am getting an exception. Is there anything I have to change to use the HTTPS protocol?…
anataliocs
  • 10,427
  • 6
  • 56
  • 72
0
votes
1 answer

How can I pass jsessionid between two applications connected to the CAS?

I have a problem with my current architecture. I have the following architecture: API (rest): Grails Application   "App-2":  Grails Application (use Http Builder)   Both applications (API & App-2) use the CAS server for authentication, so I…
Slim Tekaya
  • 337
  • 3
  • 16
0
votes
1 answer

In grails, my HTTPBuilder call the one rest URL that return a gsp page.How to display the gsp page?

I have two grails applications are application1 and application2. application1 use HTTPBuilder to call the application2 that return one template(gsp page). How can i display gsp page(the response) in my application1.I got status code 200. after that…
Anantha
  • 109
  • 1
  • 1
  • 7
0
votes
1 answer

Java.lang.NoClassDefFounderError: Could not initialize class groovy.net.http.ParserRegistry

I am currently getting this error message in SoapUi while using Groovy. Initially the code didnt compile i.e. errored with 'unable to resolve class HTTPBuilder'. To resolve this i downloaded the jar file from…
somo debe
  • 1
  • 2
  • 4
1 2 3
13
14