HTTPステータスコードの定義。

rfc2068.txt

HTTP status codes are extensible. HTTP applications are not required to understand the meaning of all registered status codes, though such understanding is obviously desirable. However, applications MUST understand the class of any status code, as indicated by the first digit, and treat any unrecognized response as being equivalent to the x00 status code of that class, with the exception that an unrecognized response MUST NOT be cached.

冒頭の"HTTP status codes are extensible."の解釈について。
コードの1桁目(クラス)に合ってれば、その後はアプリケーションで定義してしまってもいいものか迷ってます。
ここで定義されている401~415までは、TCP/IPのwell-known portみたいなもので、ここにない416~499までは使っちゃってもいいものなのかと。

なんでこんなこと考えてるかというと、FlexのFileReference#upload()で起こるHTTPStatusEventがレンスポンスのステータスコードしかくれないもんで、アップロードされたファイルをアプリで弾いたりした場合に、(すでにあるステータスコード以上に)詳しいことをクライアントで知る術がないのです。ふつうにformで投げればrjs使ってクライアントに表示などできるのですが、アップロード前にファイルサイズを知りたいという要件があるためにこいつに頼らざるをえない状態。responseHeadersにAIRアイコンが付いてるのがうらめしい。

タイトルとURLをコピーしました