Advertisement
dereksir

Untitled

Apr 5th, 2024
725
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. package com.example;
  2.  
  3. // import the necessary dependency  
  4. import org.apache.hc.client5.http.fluent.Request;
  5.  
  6. public class Main {
  7.    
  8.     public static void main(final String... args) throws Exception {
  9.         // make GET request to specified URL and fetch response content
  10.         String response = Request.get("https://httpbin.io/user-agent")
  11.                 .execute().returnContent().asString();
  12.            
  13.         // log response content to the console        
  14.         System.out.println(response);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement