HTTP Requests In Ruby

Tyler Venetsanos
1 min readJul 15, 2021

HTTP requests in Ruby are used to pass information to the server to allow the user of the application to access the data that they are requesting. When developing an API in Ruby the developer creates different endpoints to give frontend users access to specific data from the database. Depending on how the API is set up a user can use a GET request to get data from the backend and a POST request to send data to the backend.

To do so, the developer uses a Rack::Request in order to specify the correct route that the user is trying to access on the front end of the application. These requests will also allow for a users input to specify individual values to allow the user to selectively access pieces of information that are stored in the database rather than access all of the data as a whole.

In the example below, there are multiple endpoints that the user can access that will return the information stored in the database, i.e (users, games, consoles, ect.). Each endpoint has a GET request to render the information provided.

--

--