HttpBuilder-NG is a modern updated version of the HttpBuilder project which provides a unified and friendly DSL for Groovy (and Java) in on top of an Http Client (three options available). This version is based on the older project, but diverges enough that it is a different library.
When trying to upload a large zip via multipart/form-data with httpbuilder-ng apache implementation version 0.16.1 i get
org.apache.http.ContentTooLongException: Content length is too long: 109370
at…
I'm updating groovy scripts from httpbuilder to httpbuilder-ng. These scripts interact with various webservices to get messages. I'm looking to parse the responses preferably using Jackson into objects. However, I can't seem to get the raw json…
Basic Auth not working with http-builder-ng - Authorization request is not passed by ng?
build.gradle
group 'org.vinay.rest'
version '1.0-SNAPSHOT'
apply plugin: 'groovy'
apply plugin: 'java'
sourceCompatibility = 1.8
repositories {
…
I implemented this code almost exactly as listed in the examples for HttpBuilder-NG and it is not working for me. For some reason it does not recognize the multipart as a method. Example from the creators of the libraries…
I've been using HttpBuilder-NG in a large compiled project and relying on its request and response logging when debugging, but using it in a standalone Groovy script results in only output from my class, not the library's logs.
Can anyone suggest…
In my Grails app, I have a config property which includes a partial URL path, like this:
http://apis.mycompany.com/my-api/v1/
I want to invoke endpoints using this URL with HttpBuilder:
class MyApiService {
@Value('${myApiUrl}')
String…
The URI myresourceUrl when hit in browser shows the json content in browser.
Requirement:
Need to use the get method of httpbuilder-ng to call GET of URI and response should have the content as json.
This json file will be necessary as input for…
I'm trying to use Httpbuilder-NG in the Gradle script of an Android Studio project. The script uploads some files to a web server for validation, the server responds with 'ok' or the name of the file that did not validate.
I am…
I'm attempting to switch to HttpBuilder-NG but having some difficulty with it. I can't seem to find any concrete examples of working with response headers or even the response status code. It was beyond simple with the old httpbuilder - RESTClient…
I try to write some regression tests for my web application with Groovy and http-builder-ng.
To check all the headers for every request I would like to turn off
the auto redirection. To do this with http-builder there are BasicHttpParams, but I…
I'm building a groovy rest client for my java app to use with test automation. I originally wrote the service in httpBuilder, but couldn't figure out how to parse the response. On non-200 responses, I got an exception which I could catch and assert…
I'm trying to use Groovy to script a GET request to our GitLab server to retrieve a file. The API URI format is:
https://githost/api/v4/projects/%2F/files/?ref=
Note that there is an encoded '/' between namespace and…
I am trying to convert some old style Groovy HttpBuilder code to HttpBuilder-NG. One thing I had to do in old style was to add request interceptor to handle the basic authorization. This is how I did it in the old HttpBuilder
def http = new…
I am exploring using HttpBuilder-NG to perform REST calls. My first attempt simply gives me a groovy.net.http.HttpException with a traceback. No other details. Using the previous HttpBuilder I was able to turn on logging to see what is sent and…