...

/

Test Our Resources with curl

Test Our Resources with curl

Learn to use the curl command to test functions.

We can test our endpoints using the existing resources. We have two users we can access:

  • The first user has the email toto@toto.org. Its ID is 1 since it was the first resource created.
  • The second one has the email test@test.org. Its ID is 2 since it was the second resource created.

We have several ways to test our endpoints. The one we will use in this course is curl, which is integrated into almost all Linux distributions. Let’s test each one of our endpoints using the curl command.

Note: The database changes made in the widgets in this lesson are limited to these widgets.

Test the GET function

Let’s test the GET function by following the instructions below.

ruby-2.6.3
Test the 'GET' function

Click the “Run” button to open a terminal. Then open a new terminal by clicking the “++” button next to the “Terminal” tab. Initialize the rails server on the new terminal using:

$ cd usercode/workspace/market_place_api && rails s

Then switch back to the first ...