17.2: Test Post

Test the Post Method

In this section, we'll test posting a new note to the database and then retrieving it.

  1. Change the URL to api/Note

  2. Change GET to POST

  3. In order to test that data will post, we need to add data in the Body of our request

  4. Click on the Body tab and check urlencoded

  5. Enter in the Keys and Values as below

    • Make sure to use a NoteId that isn't already being used in your database

      Post

  6. Press Send and you should get a success

  7. Test that this worked by running a GET request with the end of the URL api/Note/X

    • X is the NoteId you used

  8. You should see your note in the response

    PostGetTest

Next, we'll test the Update method.

Last updated