Coder Social home page Coder Social logo

java-restful-api's Introduction

java-restful-api

Setup

  • After cloning this database, open the project in an IDE (Eclipse, IntelliJ, etc...) and run the NotesRestAPI.java class. (Alternatively, you can compile and run it in your terminal)
  • The server should be up and running at this point on localhost:4567

Testing Routes

  • Using Postman or another tool of your choice, run the following:
  1. Post http://localhost:4567/api/notes {"body": "Walk the Dog", "id": 1}
  2. Post http://localhost:4567/api/notes {"body": "Fold and put away clothes", "id": 2}
  • Now you should have some data in there. Now, go ahead and send a GET request for all the notes, or for just ONE note. Here you should see the complete list of notes, then just the note with an id of 2.:
  1. Get http://localhost:4567/api/notes
  2. Get http://localhost:4567/api/notes/2
  • Now, let's delete one of the notes, then we will check the list of all notes to ensure that the note with id:2 is gone:
  1. Delete http://localhost:4567/api/notes/2
  2. Get http://localhost:4567/api/notes

To-Do

  • Create API with POST, GET, GET All, PUT(update), DELETE paths
  • Pass in optional query parameter allowing user to search notes by their bodies
  • Automatically add in serialized id to each entry, without having to manually enter it in POST request

java-restful-api's People

Contributors

hillrg22 avatar

Watchers

James Cloos 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.