https://github.com/imran-2022/spring_rest_api
REST API USING JAVA SPRING BOOT FRAMEWORK
https://github.com/imran-2022/spring_rest_api
crud-api java spring-boot
Last synced: 23 days ago
JSON representation
REST API USING JAVA SPRING BOOT FRAMEWORK
- Host: GitHub
- URL: https://github.com/imran-2022/spring_rest_api
- Owner: Imran-2022
- License: mit
- Created: 2023-07-22T13:50:42.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-01T06:12:16.000Z (7 months ago)
- Last Synced: 2025-02-15T07:42:20.262Z (3 months ago)
- Topics: crud-api, java, spring-boot
- Language: Java
- Homepage:
- Size: 68.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## JAVA spring REST API Endpoints
#### #Get All Users
- **Endpoint:** `GET /users`
- **Description:** Get a list of all users.
- **Response:**
```
[
{
"id": 1,
"name": "Ida",
"age": 32,
"email": "[email protected]"
},
...
]
```#### #Get User by ID
- **Endpoint:** `GET /users/{id}`
- **Description:** Get a specific user by ID.
- **Parameters:**
- `id`: Integer - The ID of the user.
- **Response:**```
{
"id": 1,
"name": "Ida",
"age": 32,
"email": "[email protected]"
}
```#### #Create User
- **Endpoint:** `POST /users`
- **Description:** Add a new user.
- **Request Body:**```
{
"id": 6,
"name": "6",
"age": 6,
"email": "[email protected]"
}
```
- **Response:**
```
"Added successfully"
```#### #Update User
- **Endpoint:** `PUT /users/{id}`
- **Description:** Update an existing user.
- **Parameters:**
- `id`: Integer - The ID of the user to update.
- **Request Body:**```
{
"id": 6,
"name": "Updated User",
"age": 30,
"email": "[email protected]"
}
```- **Response:**
```
{
"id": 6,
"name": "Updated User",
"age": 30,
"email": "[email protected]"
}
```#### #Delete User
- **Endpoint:** `DELETE /users/{id}`
- **Description:** Delete a user by ID.
- **Parameters:**
- `id`: Integer - The ID of the user to delete.
- **Response:**```
"Deleted successfully"
```## Getting Started
1. Clone the repository: `git clone https://github.com/yourusername/your-repo.git`
2. Run the Spring Boot application: `mvn spring-boot:run`
3. The application will start at `http://localhost:8080`.