httpresponseヘッダーでコンテンツタイプが送信されない場合、どのような問題がありますか?具体的には、content_typeが省略された場合、以下のようなJSONタイプはどうなりますか? HTTP仕様コンテンツタイプによるをヘッダーの1つとして渡されるべきコンテンツタイプがhttpで送信されない場合、どのような問題がありますか?
class JSONResponse(HttpResponse):
"""
An HttpResponse that renders its content into JSON.
"""
def __init__(self, data, **kwargs):
content = JSONRenderer().render(data)
kwargs['content_type'] = 'application/json'
super(JSONResponse, self).__init__(content, **kwargs)
の最後のセクションを参照してください。その後、Webサーバーは、デフォルトのタイプを推測して設定します。クライアントは、そのタイプが何であるかを自由に推測できます。データは引き続き転送されますが、 –