所以我有一個網站已經完全工作,在URL中編碼了一些URI。錯誤的URI Ruby on Rails:是因爲長?
然而,當我嘗試將URL傳遞給我的Chrome瀏覽器:
http://somewhere:3000/find/someOne?utf8=%E2%9C%93&search=someThing&choicen=no&querys={%22peopleName%22%3A%22%22%2C%22peopleGroup%22%3A%22%22%2C%22place%22%3A%22%22%2C%22pip%22%3A%22%22%2C%22hw%22%3A%22%22%2C%22somerock%22%3A%22%22%2C%22rocksomerock%22%3A%22%22%2C%22diedAt%22%3A%222016-01-01%20-%202016-12-31%22%2C%22borndAt%22%3A%22%22%2C%22taxRate%22%3A%22%22}
- 它拋出我在瀏覽器中的錯誤:
Bad Request
bad URI `/find/someOne?utf8=%E2%9C%93&search=someThing&choicen=no&querys={%22peopleName%22%3A%22%22%2C%22peopleGroup%22%3A%22%22%2C%22place%22%3A%22%22%2C%22pip%22%3A%22%22%2C%22hw%22%3A%22%22%2C%22somerock%22%3A%22%22%2C%22rocksomerock%22%3A%22%22%2C%22diedAt%22%3A%222016-01-01%20-%202016-12-31%22%2C%22borndAt%22%3A%22%22%2C%22taxRate%22%3A%22%22}'.
WEBrick/1.3.1 (Ruby/1.9.3/2014-11-13) at somewhere.com:3000
同時顯示[2016-07-04 18:11:31] ERROR bad URI
在導軌控制檯
版本:
-
個
- Rails3中
- 的Ruby 1.9.3
不知道如何得到它的工作?是因爲URI中的{
和}
還是因爲它太長?
我首先嚐試uuencoding的''{/'} '看看是否能解決這個問題。 –
請修改您的問題以包含您的代碼。另外,請澄清你的問題。 「當我嘗試粘貼URL時」是什麼意思?將它粘貼在哪裏? –