LoginSignup
1
3

More than 5 years have passed since last update.

[めも]HTTP 204

Last updated at Posted at 2016-12-04

Androidで、Google Play Servicesを触っていた時に、204が返ってきたので、メモ。
例:Got network response. code, size: 204, 0

HTTPのレスポンスコード204は、"204 No Content"のこと

Contentが無いのは、ユーザに返すべき処理(ページの表示内容の更新など)が無いから。

ようするに、投げっぱなしでよい処理だから、204。
レスポンスが200なら、ページの表示内容を更新したりしますよね?

ちなみに、サーバ上にリソースを(更新ではなく)作成した場合などで、ページの表示内容の更新などが無い場合は、レスポンス201 Createdを使うそうです。

参考

MDN:204 No Content
https://developer.mozilla.org/ja/docs/Web/HTTP/Status/204

The HTTP 204 No Content success status response code indicates that the request has succeed, but that the client doesn't need to go away from its current page.

(訳)
HTTPの応答コード204は、リクエストが成功した事を示しますが、
クライアントは現在のページから遷移する必要はありません。

※どなたか、お願いします!
MDNの、204 No Contentのページの日本語訳を作成しましたが、エラーが発生して、HTTPSidebarを追加できません。可能であれば、追加をお願いします。

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3