Simple spring Boot http-server with Greeting API
mvn spring-boot:runThis Spring Boot application provides a simple Greeting API with the following endpoints:
- Endpoint:
/greeting - Method:
POST - Request Parameter:
name(String) - Usage:
curl -X POST "http://localhost:8080/greeting?name=John"
- Endpoint:
/greeting/{id} - Method:
GET - Path Variable:
id(Long) - The ID of the greeting - Usage:
curl "http://localhost:8080/greeting/1"
- Endpoint:
/greeting/{id} - Method:
PUT - Path Variable:
id(Long) - The ID of the greeting - Request Parameter:
name(String) - Usage:
curl -X PUT "http://localhost:8080/greeting/1?name=Jane"
- Endpoint:
/greeting/{id} - Method:
DELETE - Path Variable:
id(Long) - The ID of the greeting - Usage:
curl -X DELETE "http://localhost:8080/greeting/1"
- Endpoint:
/greetings - Method:
GET - Usage:
curl "http://localhost:8080/greetings"
curl -X POST http://localhost:8080/greetingDT \
-H "Content-Type: application/json" \
-d '{"name": "John", "message": "Hello there!"}'