Questions tagged [httpbuilder-ng]

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.

Useful Links

18 questions
5
votes
0 answers

httpbuilder-ng multipart/form-data with large application/zip part

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…
3
votes
0 answers

Getting raw json string or customer jackson mapper from httpbuilder-ng get request

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…
alexnanrick
  • 31
  • 1
  • 3
3
votes
2 answers

basic auth http-builder-ng

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 { …
Vinay
  • 33
  • 4
2
votes
1 answer

httpbuilder-ng no signature of method multipart() when attempting a post

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…
JJ Welch
  • 23
  • 2
1
vote
0 answers

Why are my Library Logs Missing in a Groovy Script?

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…
jsparks
  • 150
  • 1
  • 8
1
vote
1 answer

How do I use HttpBuilder with a partial path in the URL?

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…
RMorrisey
  • 7,637
  • 9
  • 53
  • 71
1
vote
2 answers

how to extract response as json from http ng-builder

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…
IKnowNothing
  • 21
  • 1
  • 2
1
vote
1 answer

Get response body on success in HTTPBuilder-NG

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…
ExactaBox
  • 3,235
  • 16
  • 27
1
vote
1 answer

Trying out HttpBuilder-NG - replacing old HttpBuilder or wslite

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…
S Bateman
  • 13
  • 5
1
vote
1 answer

Configure the http client of httpbuilder ng to not follow 302 redirects

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…
daskai0815
  • 175
  • 1
  • 2
  • 7
1
vote
1 answer

How can I parse success or throw error with HttpBuilder-ng

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…
thejames42
  • 447
  • 6
  • 22
1
vote
2 answers

How do I escape a '/' in the URI for a GET request?

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…
Jeff Vincent
  • 433
  • 5
  • 10
1
vote
1 answer

Proper way to add a Basic authorization request interceptor in HttpBuilder-NG

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…
Erik Husby
  • 21
  • 3
1
vote
1 answer

How does one configure logging in HttpBuilder-NG to see what is going back and forth

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…
Erik Husby
  • 21
  • 3
0
votes
1 answer

Response is always empty

I'm trying to execute a simple HTTP request: @Grab(group='io.github.http-builder-ng', module='http-builder-ng-apache', version='1.0.4') import groovyx.net.http.* HttpBuilder http = HttpBuilder.configure { request.uri =…
xehpuk
  • 7,814
  • 3
  • 30
  • 54
1
2