This project is part of a series of projects to be completed by students of Microverse.
In this project, we take a look at sending requests via the RestClient manually, from the command-line via our Rails app. This is a short and simple project that uses a script to run the requests.
The specifications and the guide to the project can be found on the 'Sending Params with RestClient'.
Similar to the previous project, 'Rails RestClient', which saw us using the RestClient gem to make some simple HTTP requests, in this project, we take concepts learned, a little further.
The final objective here, was to have a short Ruby script, that when executed via the command-line would return to the user the HTTP responses for the 4 GET actions (index, show, new & edit) as well as the response for 1 POST action (create).
- Ruby 2.6.5
- Ruby on Rails 6.0.2.1
- RestClient 2.1.0 gem
- Rubocop 0.79.0
- Stickler CI
Using this project should be fairly straight forward. There are however some prerequisites for your system in order to run this program:
- You must have Ruby installed. Don't know if you have it installed or how to install it? Follow this guide
- You must have the Ruby on Rails gem installed. To install, simply run
gem install rails
in your terminal or enterrails -v
to verify if it is installed already. Need help? Head here. - Once you have the above sorted, install the 'RestClient' gem. Enter the follwing into your terminal:
gem install rest-client
. It should complete without any problems.
Once all of the above is completed and you have this repository downloaded to your machine, open your terminal, cd
into apps/script
in this repository and enter ruby rest_requester.rb
into your terminal to run the app.
N.B. running the app will run without error, bar the last POST method. This fails (on purpose!) because Rails does not let us submit sensistive form data via the command-line!
If you have any issues setting up the project or you come across any unintended bugs or problems, please do submit an issue to the Rails_RestClient Issue Page
If you want to make your own changes, modifications or improvements to our project, go ahead and Fork it!
- Fork it (https://github.com/Qoosim/RestClient-Params/fork)
- Create your working branch (git checkout -b [choose-a-name])
- Commit your changes (git commit -am 'what this commit will fix/add/improve')
- Push to the branch (git push origin [chosen-name])
- Create a new Pull Request
Qoosim AbdulGhaniyy - Github
Rory Hellier - GitHub
Give a ⭐️ if you like this project!