Skip to content

sinbaddoraji/BookStore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project is a simple RESTful API for a bookstore, built using ASP.NET Core and Entity Framework Core. The API allows you to perform CRUD operations on books, such as creating, reading, updating, and deleting book records.

API Endpoints

1. Retrieve all books

  • URL: /api/books
  • Method: GET
  • Success Response:
    • Code: 200 OK
    • Content: List of books

2. Retrieve a single book by its ID

  • URL: /api/books/{id}
  • Method: GET
  • URL Parameters: id (string)
  • Success Response:
    • Code: 200 OK
    • Content: Book object
  • Error Response:
    • Code: 404 Not Found

3. Add a new book

  • URL: /api/books
  • Method: POST
  • Data Parameters: JSON object representing the book
    • Example: {"Id": "1", "Title": "Book Title", "Author": "Book Author", "Price": 9.99}
  • Success Response:
    • Code: 201 Created
    • Content: Created book object
  • Error Response:
    • Code: 409 Conflict if the book with the specified ID already exists

4. Update an existing book's details

  • URL: /api/books/{id}
  • Method: PUT
  • URL Parameters: id (string)
  • Data Parameters: JSON object representing the updated book
    • Example: {"Id": "1", "Title": "Updated Title", "Author": "Updated Author", "Price": 19.99}
  • Success Response:
    • Code: 204 No Content
  • Error Response:
    • Code: 400 Bad Request if the book ID in the URL and body do not match
    • Code: 404 Not Found if the book with the specified ID is not found

5. Delete a book

  • URL: /api/books/{id}
  • Method: DELETE
  • URL Parameters: id (string)
  • Success Response:
    • Code: 204 No Content
  • Error Response:
    • Code: 404 Not Found if the book with the specified ID is not found

About

Simple Restful API that handles the books in an library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published