Sinatra Basics : HTTP verbs
To learn about the HTTP verbs GET, POST, PATCH, PUT, DELETE that is used in a RESTful webservice.
require 'sinatra' get '/articles' do 'listing of all the articles' end get '/article/:id' do 'get the article with the given id' end post '/article' do 'create a new article' end put '/article/:id' do 'update an existing article' end patch '/article/:id' do 'update part of the existing article' end delete '/article/:id' do 'delete the article' end
Install Advanced REST client chrome extension.
Run the application:
bundle exec shotgun rest.rb
Play with REST client using the following URLs in REST client Chrome extension.
In this article, you learned about the HTTP verbs and saw the request and response using Advanced REST client Chrome extension.
Ace the Technical Interview
- Easily find the gaps in your knowledge
- Get customized lessons based on where you are
- Take consistent action everyday
- Builtin accountability to keep you on track
- You will solve bigger problems over time
- Get the job of your dreams
Take the 30 Day Coding Skills Challenge
Gain confidence to attend the interview