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

Groovy string changes when used in URI addQueryParam

The following is part of a script to make a Rest query using HTTPbuilder. The aim is to make successive queries and increment the day each time. The value of the StartDate and EndDate string change when they are used in the uri.addQueryParam and…
Mondo
  • 163
  • 13
0
votes
1 answer

HTTPBuilder - Cannot invoke method withInputStream() on null object

I have a groovy script using HTTPBuilder to make a RestAPI call to an SSL site. To connect I have imported the certs into a new keystore and use the recommended code in the HTTPBuilder support pages …
Mondo
  • 163
  • 13
0
votes
1 answer

httpbuilder and apache.poi.workbook maven problems

In Maven POM file I have the following: org.codehaus.groovy.modules.http-builder http-builder 0.7.1
0
votes
1 answer

Groovy HttpBuilder getting header's value

I'am trying to get headers in from HttpBuilder and confused about difference between using headers."Header name" and headers["Header name"] HTTPBuilder builder = new…
Rundom
  • 87
  • 1
  • 7
0
votes
2 answers

HTTPBuilder & Session ID

I have the following code to connect to a REST API service, authenticate, retrieve a session ID then make further requests passing the session ID to authenticate. The initial request works and I get a HTTP 200 OK plus the session ID in the response,…
Mondo
  • 163
  • 13
0
votes
2 answers

How to set up logging.properties for HTTPBuilder in Java

I'm trying to get the logs of my connection with HTTP Builder. I read a lot and heard to set up a configuration file. I'm executing my jar from the terminal with this command java -jar -Djava.util.logging.config.file=logging.properties…
0
votes
1 answer

Why does HTTPBuilder throw "HttpResponseException: Bad Request"?

Http-builder: 0.7.1 | Language: Groovy | Framework: Spock Testing Code import groovyx.net.http.HTTPBuilder import spock.lang.Specification /** * Created by Long Nguyen on 4/11/2017. * * Chatwork api documentation:…
Long Nguyen
  • 9,898
  • 5
  • 53
  • 52
0
votes
2 answers

How to receive a GZIP response with RESTClient

I am using a service that only works with GZIP compression. I added the accept header and the service works, but RESTClient can not parse the content correctly. My code: def client = new RESTClient('https://rest-service-gziped.com') def postBody = […
Fernando
  • 2,131
  • 3
  • 27
  • 46
0
votes
1 answer

IllegalAccessException tried to access StringHashMap - Groovy

I started to wrote some scripts in groovy. I wrote this script which basically parses an html page and does something with the data. Now, I use HTTPBuilder to perform the http request. Whenever I try to execute this kind of request, I get this…
David Lasry
  • 829
  • 3
  • 12
  • 31
0
votes
1 answer

SoapUING - Groovy - HTTPBuilder - PKIX Path building Failed Error

I'm fairly new to Groovy & SoapUING. I hope someone can help me figure out and fix this error. Thanks! What I'm trying to do: Iterate through each db row item in a table and use that as input to make a HTTPBuilder request (GET or POST) either as a…
ssc
  • 35
  • 2
  • 9
0
votes
1 answer

Getting the response for REST API using HTTPBuilder

I am trying to call a get method(HttpGetJson) to return the response value and use it to get the resp(for response code) and json(for content) values from it. But I get valid outputs only when I return resp and json separately from response.success.…
Rebeller
  • 49
  • 1
  • 6
0
votes
0 answers

HttpBuilder uploading file without extension

So I got this gradle script that let's me upload apks to Nexus. The issue is that those files end up without file extension on the server which is a problem if you want to download an app from there. It seems that I'm passing the proper mime type…
Painy James
  • 805
  • 2
  • 13
  • 26
0
votes
2 answers

How to set Content-Length in a put request with Groovy HttpBuilder

I am trying to use HttpBuilder in Groovy to suspend a GitHub user, but got a null pointer error at the last line. The REST API is defined here: https://developer.github.com/v3/users/administration/ String path =…
Jirong Hu
  • 2,315
  • 8
  • 40
  • 63
0
votes
0 answers

HttpBuilder: "peer not authenticated", works fine in Postman

I'm experiencing a problem accessing a paypal (sandbox) API. The code import groovyx.net.http.* import static groovyx.net.http.ContentType.* import static groovyx.net.http.Method.* HTTPBuilder http = new HTTPBuilder(…
injecteer
  • 20,038
  • 4
  • 45
  • 89
0
votes
0 answers

ResponseParseException:OK - HttpBuilder - RestCLient

I see the below exception when I submit my request: groovyx.net.http.ResponseParseException: OK Request: def response = new RestClient().post([ "http://endpoint/path", contentType: ContentType.JSON, body: {"s":a, "b":"af"} ]) Groovy version:…