Git Product home page Git Product logo

booklist-api's Introduction

Booklist-API

URLS

GET /books

Shows list of all books

GET http://localhost:8080/books
HTTP/1.1 200 OK
Date: Thu, 22 Nov 2018 13:50:14 GMT
Content-Length: 410
Content-Type: text/plain; charset=utf-8
Request duration: 0.027841s

[
  {
    "id": 1,
    "name": "Linux in a Nutshell",
    "isbn": "0596009305",
    "authors": [
      {
        "first_name": "Ellen",
        "last_name": "Siever"
      },
      {
        "first_name": "Stephen",
        "last_name": "Figgins"
      }
    ]
  },
  {
    "id": 2,
    "name": "The Linux Command Line",
    "isbn": "1593273894",
    "authors": [
      {
        "first_name": "William",
        "last_name": "Scotts"
      }
    ]
  },
  {
    "id": 3,
    "name": "The Linux Programming Interface",
    "isbn": "1593272200",
    "authors": [
      {
        "first_name": "Michael",
        "last_name": "Kerrisk"
      }
    ]
  }
]

POST /books

Adds a new book

POST http://localhost:8080/books
HTTP/1.1 201 Created
Date: Thu, 22 Nov 2018 13:52:24 GMT
Content-Length: 168
Content-Type: text/plain; charset=utf-8
Request duration: 0.027163s

{
  "id": 4,
  "name": "Understanding the Linux Kernel",
  "isbn": "0596005652",
  "authors": [
    {
      "first_name": "Daniel",
      "last_name": "Bovet"
    },
    {
      "first_name": "Marco",
      "last_name": "cesati"
    }
  ]
}

GET /books/{id}

Shows a single book

GET http://localhost:8080/books/10
HTTP/1.1 404 Not Found
Date: Thu, 22 Nov 2018 13:54:45 GMT
Content-Length: 25
Content-Type: text/plain; charset=utf-8
Request duration: 0.037078s

{
  "error": "book not found"
}
GET http://localhost:8080/books/1
HTTP/1.1 200 OK
Date: Thu, 22 Nov 2018 13:55:30 GMT
Content-Length: 160
Content-Type: text/plain; charset=utf-8
Request duration: 0.029872s

{
  "id": 1,
  "name": "Linux in a Nutshell",
  "isbn": "0596009305",
  "authors": [
    {
      "first_name": "Ellen",
      "last_name": "Siever"
    },
    {
      "first_name": "Stephen",
      "last_name": "Figgins"
    }
  ]
}

PUT /books/{id}

Updates a book

PUT http://localhost:8080/books/4
HTTP/1.1 200 OK
Date: Thu, 22 Nov 2018 13:56:40 GMT
Content-Length: 166
Content-Type: text/plain; charset=utf-8
Request duration: 0.133558s

{
  "id": 4,
  "name": "Understanding the Linux Kernel",
  "isbn": "new_isbn",
  "authors": [
    {
      "first_name": "Daniel",
      "last_name": "Bovet"
    },
    {
      "first_name": "Marco",
      "last_name": "cesati"
    }
  ]
}

DELETE /books/{id}

Deletes a book

DELETE http://localhost:8080/books/4
HTTP/1.1 200 OK
Date: Thu, 22 Nov 2018 13:57:09 GMT
Content-Length: 166
Content-Type: text/plain; charset=utf-8
Request duration: 0.029016s

{
  "id": 4,
  "name": "Understanding the Linux Kernel",
  "isbn": "new_isbn",
  "authors": [
    {
      "first_name": "Daniel",
      "last_name": "Bovet"
    },
    {
      "first_name": "Marco",
      "last_name": "cesati"
    }
  ]
}
GET http://localhost:8080/books/4
HTTP/1.1 404 Not Found
Date: Thu, 22 Nov 2018 13:57:27 GMT
Content-Length: 25
Content-Type: text/plain; charset=utf-8
Request duration: 0.011443s

{
  "error": "book not found"
}

booklist-api's People

Contributors

tahsinrahman avatar

Stargazers

Mohammad Fahim Abrar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.