mkdir demo
cd demo
gradle init
다음은 예시이다. 상황에 맞게 적절하게 선택하면 된다.
sojeongyoo@Sojeongui-MacBookAir http-client % gradle init
Select type of project to generate:
1: basic
2: application
3: library
4: Gradle plugin
Enter selection (default: basic) [1..4] 2
Select implementation language:
1: C++
2: Groovy
3: Java
4: Kotlin
5: Scala
6: Swift
Enter selection (default: Java) [1..6] 3
Generate multiple subprojects for application? (default: no) [yes, no] no
Select build script DSL:
1: Kotlin
2: Groovy
Enter selection (default: Kotlin) [1..2] 2
Select test framework:
1: JUnit 4
2: TestNG
3: Spock
4: JUnit Jupiter
Enter selection (default: JUnit Jupiter) [1..4] 4
Project name (default: http-client): client
Source package (default: client): com.ahastudio.http.client
Enter target version of Java (min. 7) (default: 18):
Generate build using new APIs and behavior (some features may change in the next
> Task :init
To learn more about Gradle by exploring our Samples at https://docs.gradle.org/8.3/samples/sample_building_java_applications.html
idea .
App.Test.java
파일을 다음과 같이 수정한다.
App.java
파일을 다음과 같이 수정한다.
Gradle 로 시작하도록 수정한다.
curl localhost:8080
or
http localhost:8080
Body 에 데이터를 넣고 싶다면?
http localhost:8080 name=tester