I have a simple ruby server something like :
app = Proc.new do |env|
puts 'am I receiving anything ? '
req = Rack::Request.new(env).params
puts "if yes any parameters ? : #{req.inspect}"
end
Rack::Handler::Thin.run(app, :Port => 4001, :threaded => true)
How am I supposed to receive POST request with the parameters , I’m sending some JSON object using post but I can see nothing like i’m receiving nothing when I send POST to localhost:4001 .
That’s because you are not returning a response. Your response is empty so you won’t see anything. You can test this through cURL:
Response from within app:
Try returning something: