Q:

Setup ruby server for custom api

I am trying to implement an API that should run smoothly on a server created. Here is the code for the custom API (I didn't make it). The file name for that custom API is pings.rb. Then I created a server.rb, which looks like:
require 'sinatra'
get '/clear_data' do
  status 200
end

When I run server.rb, it successfully runs the server, but when I type ruby pings.rb, it returns some errors in the API.
What would be a possible error in my server, which made the API not run smoothly?

A:

Your error message says a post should return a code of 200 and it's not, however the route you've defined is a get request. Try:
post '/clear_data' do
  status 200
end

