Last active
November 19, 2019 05:53
-
-
Save AkshayMathur92/7222df7422c80bc8681b2eb8079e57d8 to your computer and use it in GitHub Desktop.
WebClient
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author : akshay.mathur | |
**/ | |
@Singleton | |
public class WebClient { | |
private final Client client; | |
@Inject | |
public WebClient(Client client) { | |
this.client = client; | |
} | |
public Object get(String url){ | |
WebTarget target = client.target(url); | |
Invocation.Builder invocationBuilder = target.request(MediaType.TEXT_PLAIN); | |
Response response = invocationBuilder.get(); | |
return response.getEntity(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment