Advertisement
dereksir

Untitled

Apr 5th, 2024 (edited)
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. // create an HttpRequest instance
  2. HttpRequest request = HttpRequest.newBuilder()
  3.     .uri(URI.create("https://httpbin.io/user-agent"))
  4.     // set custom user agent header
  5.     .header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36") // set the User-Agent header
  6.     .build(); // build request
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement