About 1,190,000 results
Open links in new tab
  1. Test a REST API with Java - Baeldung

    Jan 26, 2025 · In this tutorial, we’ll focus on the principles and mechanics of testing a REST API through integration tests. Specifically, we’ll be testing the API with live requests and JSON payloads to ensure its correctness and behavior.

  2. mathare/api-testing-java-httpclient - GitHub

    By using the Java HTTP Client this project illustrates how a powerful API testing solution can be built using only core Java functionality. The REST API being tested by this project is the JSON Placeholder API, a simple third-party API that has endpoints suitable for demonstrating many key principles of automated API testing.

  3. Exploring the New HTTP Client in Java - Baeldung

    Jan 8, 2024 · In this tutorial, we’ll explore Java 11’s standardization of HTTP client API that implements HTTP/2 and Web Socket. It aims to replace the legacy HttpUrlConnection class that has been present in the JDK since the very early years of Java.

  4. Java Apache HttpClient REST (RESTful) client examples

    Feb 3, 2024 · I started writing some Java REST (RESTful) clients lately, and in doing so, I've been looking at several different ways to do this, including using the Apache HttpClient project, the Jersey project, Apache CXF, and more.

  5. Posting with Java HttpClient - Baeldung

    Jan 18, 2024 · In this article, we explored sending POST requests using Java HttpClient API introduced in Java 11. We learned how to create an HttpClient instance and prepare a POST request. We saw how to send prepared requests synchronously, asynchronously, and …

  6. How to Test Java HTTP Client Usages (e.g. OkHttp, Apache HttpClient)

    Dec 17, 2020 · Test Java classes that use a common HTTP client (e.g. OkHttp, Apache HttpClient, etc.) without mocking the internals by using MockWebServer.

  7. Java 11 Standardized HTTP Client API Example

    Apr 18, 2019 · In this article, we will test a REST API application using the Java HTTP Client API. 1. Introduction. There are many tools available to test your REST API applications. There are command line tools, such as cURL, and there are GUI tools, such as Postman and SoapUI that can perform these tasks.

  8. RESTful Java client with Apache HttpClient - Mkyong.com

    Jul 14, 2011 · Apache HttpClient is a robust and complete solution Java library to perform HTTP operations, including RESTful service. In this tutorial, we show you how to create a RESTful Java client with Apache HttpClient, to perform a “ GET ” and “ POST ” request. The RESTful services from last “ Jackson + JAX-RS ” article will be reused. 1.

  9. Apache HttpClient Examples for Consuming REST APIs

    Dec 13, 2024 · Apache HttpClient simplifies the interactions with RESTful APIs by supporting various HTTP methods, headers, and request configurations. This article will explore how to consume REST APIs using Apache HttpClient5 with examples. 1. Setup Before diving into implementation, we need to import the latest version of Apache HttpClient. Next, …

  10. Java HttpClient API Tutorial with Examples - HelloKoding

    Mar 24, 2020 · Since Java 11, you can use HttpClient API to execute non-blocking HTTP requests and handle responses through CompletableFuture, which can be chained to trigger dependant actions. The following example sends an HTTP GET request and retrieves its response asynchronously with HttpClient and CompletableFuture

  11. Some results have been removed
Refresh