0
次のコードでは、入力パラメータt
を取り、同じ値を返します。+ signはweb.pyの入力パラメータ(GETリクエスト)を排除します
import web
urls = (
'/test(.*)', 'test',
)
class test(web.storage):
def GET(self,r):
t = web.input().q
print t
return t
if __name__ == "__main__":
app = web.application(urls, globals())
app.run()
私はブラウザ
http://localhost:8080/test?q=word1-word2
しかし、+、それはそれを排除署名がある中で、以下のURLを実行したときにこれが正常に動作します。
http://localhost:8080/test?q=word1+word2
戻る
WORD1のWORD2予想結果が
WORD1 + WORD2
どうすればこの問題を防ぐことができますか?クエリ文字列エンコーディング
ありがとうございます –