jpw*_*ynn 3 param http-post sinatra
我们正在使用第三方Web服务将POSTS多部分数据(文件)发回给我们.但它也通过网址传递额外的参数 http://ourdomain.com/theposturl?extra=good
'filename'对象:filename和:二进制数据的tempfile是params []
但是我们如何从网址中获得"好"呢?
post /theposturl
puts params.inspect # this shows a hash with filename,
# :filename and :tempfile as expected
extra_param = ??????[:extra] # but what lets us 'read' the ?extra=good off the url
end
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3433 次 |
| 最近记录: |