jwagenleitner / groovy-wslite

Lightweight SOAP and REST webservice clients for Groovy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calling wslite RESTClient from java?

lowrider59 opened this issue · comments

Can I get some help here?

I have some groovy-classes, I'm trying to rewrite to Java.

The groovy-code uses wslite for REST-calls, and follows this pattern:

JsonBuilder request = createRequest();
Map<String, Object> params = createParams();
RESTClient client = new RESTClient(endpoint);
Response response = client.put(params) ( it -> { text(request); });

How do I rewrite the final line with the Closure part?

What is the Java equivalent?