Skip to content
This repository was archived by the owner on Mar 3, 2022. It is now read-only.

4akhilkumar/SpringBootAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpringBootAPI

Spring Boot API - GET, POST, PUT, DELETE with MySQL Database

application.properties

spring.datasource.url= jdbc:mysql://localhost:3306/{database_name}
spring.datasource.username={username}
spring.datasource.password={password}
spring.jpa.hibernate.ddl-auto=create-drop
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
server.error.include-message=always

API Requests

  • GET - http://localhost:8080/api/v1/student/
  • POST - http://localhost:8080/api/v1/student

    Headers

    • Name: Content-Type
    • Value: application/json

    Body

    {
      "name": "Rakesh",
      "email": "dsrkreddy81@gmail.com",
      "dob": "2000-01-05"
    }
  • PUT - http://localhost:8080/api/v1/student/1?{field_name}={value}
  • DELETE - http://localhost:8080/api/v1/student/{id}

Sample Data in JSON Format

[
  {
    "id":1,
    "name":"Pavan",
    "email":"pavannerella28@gmail.com",
    "dob":"2000-01-05",
    "age":21
  },
  {
    "id":2,
    "name":"Chinna",
    "email":"7radha3krishna@gmail.com",
    "dob":"2001-03-05",
    "age":20
  },
  {
    "id":3,
    "name":"Mohan",
    "email":"mvamsi73@gmail.com",
    "dob":"2002-04-05",
    "age":19
  },
  {
    "id":4,
    "name":"Rakesh",
    "email":"dsrkreddy81@gmail.com",
    "dob":"2000-01-05",
    "age":21
  }
]

About

Spring Boot API - GET, POST, PUT, DELETE with MySQL Database

Topics

Resources

License

Stars

Watchers

Forks

Languages