Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/omerjuve2023/http-client
In this tutorial you will learn how to call a REST API using the JDK's Http Client. In this example you will call a public REST API and build out an entire CRUD service complete with tests using JUnit 5.
https://github.com/omerjuve2023/http-client
backend http-client java learn maven spring test web
Last synced: 22 days ago
JSON representation
In this tutorial you will learn how to call a REST API using the JDK's Http Client. In this example you will call a public REST API and build out an entire CRUD service complete with tests using JUnit 5.
- Host: GitHub
- URL: https://github.com/omerjuve2023/http-client
- Owner: OmerJuve2023
- License: agpl-3.0
- Created: 2024-05-07T04:35:39.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-06-02T18:49:44.000Z (7 months ago)
- Last Synced: 2024-10-31T15:05:19.860Z (2 months ago)
- Topics: backend, http-client, java, learn, maven, spring, test, web
- Language: Java
- Homepage:
- Size: 93.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Http-Client
In this tutorial you will learn how to call a REST API using the JDK's Http Client. In this example you will call a
public REST API and build out an entire CRUD service complete with tests using JUnit 5.## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing
purposes.### Prerequisites
- Java 17 or higher
- Maven
- Docker (optional)
- IntelliJ IDEA (optional)
- Postman (optional)### Installing
A step by step series of examples that tell you how to get a development environment running.
1. Clone the repository
```bash
git clone https://github.com/OmerJuve2023/http-client.git
```2. Change into the project directory
```bash
cd JpsOwnStarted
```3. Build the project
```bash
mvn clean install
```4. Run the project
```bash
mvn spring-boot:run
```5. Open your browser and navigate to `http://localhost:8080/api/posts`
## Running the tests
To run the tests, execute the following command:
```bash
mvn test
```## Running the application with Docker
1. Build the Docker image
```bash
docker build -t http-client
```2. Run the Docker container
```bash
docker run -p 8080:8080 http-client
```## Built With GraalVM
1. Build the native image
```bash
mvn -Pnative spring-boot:build-image
```2. Run the native image
```bash
docker run -p 8080:8080 http-client
```## Authors
- **OmerJuve2023** - [OmerJuve2023](https://github.com/OmerJuve2023)