私はこの行動に戸惑っています。コードは単にリクエストのタイプを出力します。最初のメソッドは機能しますが、2番目のメソッドは空の文字列を返します。クラスのタイプはdjango.corehandlers.wsgi.WSGIRequestです。
(明確にするために編集)
def someview(request):
html+="<p>type of the request each char "
for i in range(47):
html+= (str(type(request))[i])
html+="</p>"
html+="<p>type of the request each char "
for i in range(47):
html+= repr(str(type(request))[i])
html+="</p>"
return HttpResponse(html)
結果は次のようになります。2番目の文字列は空です。
type of the request each char '<''c''l''a''s''s'' '"'"'d''j''a''n''g''o''.''c''o''r''e''.''h''a''n''d''l''e''r''s''.''w''s''g''i''.''W''S''G''I''R''e''q''u''e''s''t'"'"'>'
type of the request: