Skip to content

AnshumaliP/basic-http-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

basic-http-server

Simple spring Boot http-server with Greeting API

Run the server via :

  mvn spring-boot:run

Greeting API Endpoints

This Spring Boot application provides a simple Greeting API with the following endpoints:

1. Create a New Greeting

  • Endpoint: /greeting
  • Method: POST
  • Request Parameter: name (String)
  • Usage:
    curl -X POST "http://localhost:8080/greeting?name=John"

2. Retrieve a Specific Greeting

  • Endpoint: /greeting/{id}
  • Method: GET
  • Path Variable: id (Long) - The ID of the greeting
  • Usage:
    curl "http://localhost:8080/greeting/1"

3. Update an Existing Greeting

  • 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"

4. Delete a Greeting

  • Endpoint: /greeting/{id}
  • Method: DELETE
  • Path Variable: id (Long) - The ID of the greeting
  • Usage:
    curl -X DELETE "http://localhost:8080/greeting/1"

5. List All Greetings

  • Endpoint: /greetings
  • Method: GET
  • Usage:
    curl "http://localhost:8080/greetings"

6. Testing with JSON payload

curl -X POST http://localhost:8080/greetingDT \
-H "Content-Type: application/json" \
-d '{"name": "John", "message": "Hello there!"}'

About

A basic HTTP server using Spring Boot Framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages