About 687,000 results
Open links in new tab
  1. java - Is there any way to find the request payload structure by using ...

    Oct 5, 2017 · if you want to see the request payload, you may have a look at this in paragraph "Request/response related properties" You can check headers, data, url etc. by doing ie. console.log(request.data)

  2. java - How to get URL of REST endpoint? - Stack Overflow

    Jul 29, 2017 · Look at your HelloWorld.java ; both resources just print a hardcoded "Hello World". If you want that dynamic stuff you are describing, I suggest you to look at jaxrs documentation (Path annotation and PathParam).

  3. java - How do I get the full request URL with host-name/ip of a …

    Mar 9, 2015 · I need to get the full url with the host name or IP address from a restful request made to my rest service. Is there any way this can be done? Similar to InetAddress ip = ip.getHostName(); in java.

  4. Do a Simple HTTP Request in Java - Baeldung

    Mar 26, 2025 · In this quick tutorial, we present a way of performing HTTP requests in Java — by using the built-in Java class HttpUrlConnection. Note that starting with JDK 11, Java provides a new API for performing HTTP requests, which is meant as a replacement for the HttpUrlConnection, the HttpClient API.

  5. Java REST APIs: Design & Best Practices | Medium

    Dec 11, 2023 · In Java, this is typically achieved through specific URI patterns and using standard HTTP methods (GET, POST, PUT, DELETE, PATCH). Statelessness: Every request from a client to a server must...

  6. Send a GET request in Java - restful-api.dev

    A Tutorial on how to send the HTTP GET request in Java to the REST API and fetch a response as an object

  7. How to communicate with a Rest Api in Java - Medium

    Jun 13, 2019 · Sending A GET Request to The Api: URL obj = new URL(url); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); if (con instanceof HttpURLConnection) {// Reason to use mozilla/5.0...

  8. How to Design URL to REST Resource - Java Guides

    In this post, we will learn how to design a URL for REST API and the best practices for designing a URL for a resource. Finally, we will see case studies of real-world examples. In the previous post, we learned How to Identify REST Resources .

  9. Simplest way to call REST API and parse JSON data with Java

    Aug 2, 2019 · In Java, I want to call the URL and get the href Strings as a List. In JavaScript, I would simply write. fetch("https://images-api.nasa.gov/search?q=moon") .then(data => data.json()) .then(data => { const items = data .collection .items .map(item => item.links) .flat() .filter(link => link.rel === "preview") .map(link => link.href); // do ...

  10. How To Use Java HttpURLConnection for HTTP GET and POST …

    Nov 19, 2022 · Create a URL object from the GET or POST URL String. Call the openConnection() method on the URL object that returns an instance of HttpURLConnection. Set the request method in HttpURLConnection instance (default value is GET).

  11. Some results have been removed
Refresh