request function in request.rb modified to support POST requests