这是我的faxattach.rb
代码:
require 'sinatra'
require 'docsplit'
require './sinatra/faxattach_helpers'
class FaxAttach < Sinatra::Base
helpers Sinatra::FaxAttachHelpers
get '/*' do
"hello world"
status 405
end
put '/*' do
status 405
end
patch '/*' do
status 405
end
delete '/*' do
status 405
end
options '/*' do
status 405
end
link '/*' do
status 405
end
unlink '/*' do
status 405
end
post '/process' do
path = params[:path]
begin
debugger
file = test_download path
rescue
status 404
end
debugger
code = extractCode file
code
end
end
我正在使用 curl 对 /process 进行发布请求curl --data "path=URL_HERE" localhost:4567/process
,出于某种原因,我得到了:Sinatra doesn't know this ditty
. 它告诉我放入一个post /process
我显然拥有的。
有任何想法吗?