Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example;
- // import the necessary dependency
- import org.apache.hc.client5.http.fluent.Request;
- public class Main {
- public static void main(final String... args) throws Exception {
- // make GET request to specified URL and fetch response content
- String response = Request.get("https://httpbin.io/user-agent")
- .execute().returnContent().asString();
- // log response content to the console
- System.out.println(response);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement