9
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

sinatraでpostをリダイレクトする

Last updated at Posted at 2015-02-27

できませんでした。

http://kiririmode.hatenablog.jp/entry/20131202/p1
ここを参考に307でリダイレクトを試してみたけどダメだった。。

alias urlでやりたいことはできた。

http://stackoverflow.com/questions/3384134/alias-url-with-sinatra-padrino
ここに書いてある通りにPATH_INFO書き換えてあげたらいけた!
むしろこっちのほうがいい。

app.rb
post '/graph' do
  call env.merge('PATH_INFO' => '/graph/line')
end

post '/graph/line' do
  ## 処理
end
127.0.0.1 - - [27/Feb/2015:15:24:36 +0900] "POST /graph HTTP/1.1" 200 64 0.2178

ログは/graphで出るみたい。

9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?