Kode Status HTTP
Telusuri kode status per kategori. Bentangkan baris mana pun untuk melihat contoh pesan HTTP nyata bagi kode tersebut.
1xxInformasional (Informational)
100ContinueKlien sebaiknya melanjutkan pengiriman body permintaan.Contoh
→ REQUEST
POST /uploads HTTP/1.1 Host: example.com Content-Length: 5242880 Expect: 100-continue
← RESPONSE
HTTP/1.1 100 Continue (client now streams the 5 MB body) HTTP/1.1 201 Created Location: /uploads/8f2c
101Switching ProtocolsServer setuju mengganti protokol (mis. naik ke WebSocket).Contoh
→ REQUEST
GET /chat HTTP/1.1 Host: example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Sec-WebSocket-Version: 13
← RESPONSE
HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
102ProcessingMemahami kode status 102 Processing, bagaimana respons ini mencegah timeout klien pada permintaan berdurasi panjang, serta asal-usulnya di WebDAV.Contoh
→ REQUEST
GET /sample.pdf HTTP/1.1 Host: example.com
103Early HintsMemahami 103 Early Hints dan bagaimana kode status ini mempercepat pemuatan halaman dengan pramuat sumber daya sebelum respons akhir tiba.Contoh
→ REQUEST
GET /index.html HTTP/1.1 Host: example.com
2xxSukses (Success)
200OKPermintaan berhasil; respons memuat sumber daya yang diminta.Contoh
→ REQUEST
GET /products/42 HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 200 OK Content-Type: application/json Content-Length: 51 { "id": 42, "name": "Trailhead Boot", "price": 189 }
201CreatedPermintaan berhasil dan sumber daya baru telah dibuat.Contoh
→ REQUEST
POST /products HTTP/1.1 Host: example.com Content-Type: application/json { "name": "Ridge Boot", "price": 210 }
← RESPONSE
HTTP/1.1 201 Created Location: /products/43 Content-Type: application/json { "id": 43, "name": "Ridge Boot", "price": 210 }
202AcceptedPelajari arti respons 202 Accepted, bagaimana kode status ini menandakan pemrosesan asinkron, dan cara memantau hasil akhirnya.Contoh
→ REQUEST
POST /job HTTP/1.1 Host: example.com Content-Type: application/xml Content-Length: 68 <?xml version="1.0"?> <job> <id>125</id> <task>G01</task> </job>
203Non-Authoritative InformationPelajari arti respons 203 Non-Authoritative Information, kapan proxy mengembalikan 203, dan bedanya dengan 200 OK.Contoh
→ REQUEST
GET /instructions HTTP/1.1 Host: example.com
204No ContentBerhasil, tanpa body respons.Contoh
→ REQUEST
DELETE /products/43 HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 204 No Content (no body)
205Reset ContentPelajari arti respons 205 Reset Content, bagaimana kode ini meminta klien membersihkan data formulir, dan bedanya dengan 204.Contoh
→ REQUEST
POST /signup HTTP/1.1 Host: example.com Content-Type: application/xml Content-Length: 92 <?xml version="1.0"?> <person> <name>David Smith</name> <country>USA</country> </person>
206Partial ContentMemahami respons 206 Partial Content, cara kerja permintaan Range untuk unduhan yang dapat dilanjutkan, serta respons rentang multipart.Contoh
→ REQUEST
GET /videos/sample.mp4 HTTP/1.1 Host: example.com Range: bytes=25000-75000
207Multi-StatusPelajari arti respons 207 Multi-Status, bagaimana WebDAV memakai 207 untuk melaporkan hasil per sumber daya, dan cara mengurai body XML-nya.Contoh
<d:response> <d:href>http://example.re/tasks</d:href> <d:status>HTTP/1.1 200 OK</d:status> </d:response>
208Already ReportedMemahami kode status 208 Already Reported dan bagaimana WebDAV memakainya di dalam respons 207 untuk menghindari daftar sumber daya ganda.Contoh
→ REQUEST
PROPFIND /main/ HTTP/1.1 Host: example.com Depth: infinity DAV: bind Content-Type: application/xml; charset="utf-8" Content-Length: 139 <?xml version="1.0" encoding="utf-8" ?> <d:propfind xmlns:d="DAV:"> <d:prop> <d:name/> <d:link/> </d:prop> </d:propfind>
226IM UsedPelajari arti respons 226 IM Used serta bagaimana delta encoding dan manipulasi instance menghemat bandwidth pada respons HTTP.Contoh
→ REQUEST
GET /livingdocs/current_specs.pdf HTTP/1.1 Host: example.com Accept-Encoding: gzip
3xxPengalihan (Redirection)
300Multiple ChoicesMemahami respons 300 Multiple Choices, kapan server mengirim 300, dan bagaimana klien memilih di antara beberapa representasi.Contoh
→ REQUEST
GET /tech-news HTTP/1.1 Host: example.com
301Moved PermanentlySumber daya telah dipindahkan permanen ke alamat pada Location.Contoh
→ REQUEST
GET /old-path HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 301 Moved Permanently Location: https://example.com/new-path
302FoundSumber daya untuk sementara berada di Location.Contoh
→ REQUEST
GET /account HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 302 Found Location: /login
303See OtherPelajari cara kerja pengalihan 303 See Other, mengapa 303 selalu beralih ke GET, dan kapan memakainya setelah POST, PUT, atau DELETE.Contoh
→ REQUEST
DELETE /tasks/314 HTTP/1.1 Host: example.com
304Not ModifiedCache masih valid; salinan lokal bisa langsung dipakai.Contoh
→ REQUEST
GET /logo.png HTTP/1.1 Host: example.com If-None-Match: "9c2e-abc123"
← RESPONSE
HTTP/1.1 304 Not Modified ETag: "9c2e-abc123" (no body — reuse the cached copy)
305Use ProxyPelajari kode status 305 Use Proxy yang sudah usang, mengapa dihapus karena masalah keamanan, dan apa penggantinya.Contoh
→ REQUEST
GET /document.pdf HTTP/1.1 Host: example.com
307Temporary RedirectMemahami 307 Temporary Redirect, mengapa 307 mempertahankan metode permintaan tidak seperti 302, dan kapan memilihnya ketimbang 302 atau 303.Contoh
→ REQUEST
GET /news.html HTTP/1.1 Host: example.com
308Permanent RedirectMemahami 308 Permanent Redirect, bagaimana 308 mempertahankan metode permintaan tidak seperti 301, dan bagaimana mesin pencari mengalihkan bobot tautan.Contoh
→ REQUEST
POST /api/v1/orders HTTP/1.1 Host: example.com Content-Type: application/json Content-Length: 35 {"item": "widget", "quantity": 10}
4xxKesalahan Klien (Client Error)
400Bad RequestSintaks atau parameter permintaan tidak valid.Contoh
→ REQUEST
POST /products HTTP/1.1 Host: example.com Content-Type: application/json { "price": "not-a-number" }
← RESPONSE
HTTP/1.1 400 Bad Request Content-Type: application/json { "error": "price must be a number" }
401UnauthorizedPerlu autentikasi.Contoh
→ REQUEST
GET /account HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 401 Unauthorized WWW-Authenticate: Bearer realm="api"
402Payment RequiredMemahami 402 Payment Required: kode status yang dicadangkan, pemakaian non-standar oleh Shopify dan Stripe, serta dampaknya pada SEO.Contoh
→ REQUEST
GET /tech-news HTTP/1.1 Host: example.com
403ForbiddenTerautentikasi tetapi tidak berwenang.Contoh
→ REQUEST
DELETE /users/1 HTTP/1.1 Host: example.com Authorization: Bearer <valid-token>
← RESPONSE
HTTP/1.1 403 Forbidden Content-Type: application/json { "error": "admin role required" }
404Not FoundSumber daya target tidak ditemukan.Contoh
→ REQUEST
GET /products/9999 HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 404 Not Found Content-Type: application/json { "error": "product 9999 not found" }
405Method Not AllowedMetode tidak diizinkan untuk sumber daya ini.Contoh
→ REQUEST
DELETE /products HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 405 Method Not Allowed Allow: GET, POST, QUERY
406Not AcceptableMemperbaiki galat 406 Not Acceptable. Memahami negosiasi konten, header Accept, dan cara server menangani permintaan yang tak terpenuhi.Contoh
Accept: text/html, text/plain
407Proxy Authentication RequiredMemperbaiki galat 407 Proxy Authentication Required. Mempelajari skema autentikasi proxy dan header Proxy-Authenticate.Contoh
→ REQUEST
GET /documents/tech-news HTTP/1.1 Host: example.com
408Request TimeoutMemperbaiki galat 408 Request Timeout. Memahami mengapa server menutup koneksi lambat dan cara mengatasi masalah transmisi.Contoh
→ REQUEST
PUT /docs HTTP/1.1 Host: example.com Content-Type: application/pdf Content-Length: 10000
409ConflictMemperbaiki galat 409 Conflict. Memahami konflik status sumber daya, strategi penyelesaian, dan kasus umum pada API.Contoh
→ REQUEST
POST /blog/update?postid=111&flag=like HTTP/1.1 Host: example.com
410GoneMemahami 410 Gone: penghapusan permanen sumber daya, bedanya dengan 404, perilaku cache, dan dampak pada pengindeksan SEO.Contoh
→ REQUEST
GET /holiday-promotion-Jan-2021.pdf HTTP/1.1 Host: example.com
411Length RequiredMemperbaiki galat 411 Length Required. Pelajari kapan header Content-Length diperlukan dan cara mengatasi galat klien ini.Contoh
→ REQUEST
PUT /docs HTTP/1.1 Host: example.com Content-Type: application/pdf <PDF file included as message body>
412Precondition FailedMemperbaiki galat 412 Precondition Failed. Pelajari header permintaan bersyarat, kegagalan If-Match, dan pencegahan lost update.Contoh
→ REQUEST
POST /blog/update?postid=111&task=reply HTTP/1.1 Host: example.com If-Unmodified-Since: Fri, 1 Jan 2021 00:00:00 GMT Content-Type: text/plain Content-Length: 45 <Message body contains reply-text from the client>
413Content Too LargeMemperbaiki galat 413 Content Too Large. Pelajari batas ukuran server, pemakaian header Expect, dan cara menangani unggahan berlebih.Contoh
→ REQUEST
PUT /docs HTTP/1.1 Host: example.com Content-Type: application/pdf Content-Length: 10000
414URI Too LongMemperbaiki galat 414 URI Too Long. Memahami batas panjang URL, pembatasan peramban, dan cara memperpendek URI permintaan.Contoh
→ REQUEST
GET /<...a_long_URI...> HTTP/1.1 Host: example.com
415Unsupported Media TypeMemperbaiki galat 415 Unsupported Media Type. Pelajari validasi Content-Type dan Content-Encoding beserta langkah pemecahan masalah.Contoh
→ REQUEST
POST /blog/newmessage HTTP/1.1 Host: example.com Content-Type: text/plain Content-Length: 24 Good morning, Everybody!
416Range Not SatisfiableMemperbaiki galat 416 Range Not Satisfiable. Memahami permintaan rentang byte, header Content-Range, dan solusinya.Contoh
Content-Range: bytes */512
417Expectation FailedMemperbaiki galat 417 Expectation Failed. Pelajari cara kerja header Expect dan mekanisme 100-continue serta kapan 417 dikembalikan.Contoh
→ REQUEST
PUT /docs HTTP/1.1 Host: example.com Content-Type: application/pdf Content-Length: 10000 Expect: 100-continue
418I'm a teapotSaya teko — kode status easter egg dari RFC 2324.Contoh
→ REQUEST
BREW /coffee HTTP/1.1 Host: teapot.example
← RESPONSE
HTTP/1.1 418 I'm a teapot Content-Type: text/plain I refuse to brew coffee — I am a teapot.
421Misdirected RequestMemperbaiki galat 421 Misdirected Request. Memahami penggunaan ulang koneksi, perutean HTTP/2, dan pemecahan masalah Alt-Svc.Contoh
→ REQUEST
GET /tech-news HTTP/2 Host: example.com
422Unprocessable ContentMemperbaiki galat 422 Unprocessable Content. Pelajari bedanya dengan 400 dan 415, serta cara mengatasi kegagalan validasi semantik.Contoh
→ REQUEST
POST /requests HTTP/1.1 Host: example.com Content-Type: application/xml Content-Length: 101 <?xml version="1.0" encoding="utf-8"?> <request> <id>100</id> <action>start</action> </request>
423LockedMemperbaiki galat 423 Locked. Pelajari mekanisme penguncian berkas WebDAV, header Lock-Token, kode prasyarat, dan cara membuka kunci sumber daya.Contoh
→ REQUEST
PUT /documents/ HTTP/1.1 Host: example.com Content-Type: application/pdf Content-Length: 10000 <PDF file transferred>
424Failed DependencyMemperbaiki galat 424 Failed Dependency. Pelajari respons multi-status WebDAV, operasi PROPPATCH, dan penyelesaian dependensi.Contoh
→ REQUEST
PROPPATCH /update.html HTTP/1.1 Host: example.com Content-Type: application/xml; charset="utf-8" Content-Length: 305 <?xml version="1.0" encoding="utf-8" ?> <d:propertyupdate xmlns:d="DAV:" xmlns:z="urn:example"> <d:set> <d:prop> <z:seats> <z:seatnumber>100</z:seatnumber> <z:seatnumber>101</z:seatnumber> </z:seats> </d:prop> <d:prop> <d:name>Smith</d:name> </d:prop> </d:set> </d:propertyupdate>
425Too EarlyMemahami 425 Too Early: risiko replay pada early data TLS, header Early-Data, dan strategi perlindungan di sisi server.Contoh
→ REQUEST
GET /tech-news HTTP/1.1 Host: example.com Early-Data: 1
426Upgrade RequiredMemperbaiki galat 426 Upgrade Required. Pelajari syarat peningkatan protokol, header Upgrade, dan langkah penyelesaiannya.Contoh
→ REQUEST
GET /tech-news HTTP/1.1 Host: example.com
428Precondition RequiredMemperbaiki galat 428 Precondition Required. Pelajari header bersyarat seperti If-Match dan cara mencegah lost update.Contoh
→ REQUEST
PUT /reservations.txt HTTP/1.1 Host: example.com
429Too Many RequestsTerlalu banyak permintaan; terkena pembatasan laju.Contoh
→ REQUEST
GET /api/search HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 429 Too Many Requests Retry-After: 30 Content-Type: application/json { "error": "rate limit exceeded" }
431Request Header Fields Too LargeMemperbaiki galat 431 Request Header Fields Too Large. Pelajari batas ukuran header, pengurangan cookie, dan langkah pemecahan masalah.Contoh
→ REQUEST
GET /tech-news HTTP/1.1 Host: example.com Cookie: first_cookie=<very_long>; second_cookie=<long_again>
451Unavailable For Legal ReasonsMemahami 451 Unavailable For Legal Reasons: respons penyensoran, tuntutan hukum, dan pemakaian pada Exchange ActiveSync.Contoh
→ REQUEST
GET /tech-trial-updates HTTP/1.1 Host: example.com
5xxKesalahan Server (Server Error)
500Internal Server ErrorTerjadi kesalahan internal server.Contoh
→ REQUEST
GET /report HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "error": "unexpected server error" }
501Not ImplementedMemperbaiki galat 501 Not Implemented. Memahami metode HTTP yang tidak didukung, bedanya dengan 405, dan konfigurasi server.Contoh
→ REQUEST
POST /requests?id=111&flag=start HTTP/1.1 Host: example.com
502Bad GatewayGateway menerima respons tidak valid dari upstream.Contoh
→ REQUEST
GET /api/users HTTP/1.1 Host: gateway.example.com
← RESPONSE
HTTP/1.1 502 Bad Gateway Content-Type: text/plain upstream sent an invalid response
503Service UnavailableLayanan tidak tersedia sementara (kelebihan beban atau sedang perawatan).Contoh
→ REQUEST
GET / HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 503 Service Unavailable Retry-After: 120 Content-Type: text/plain under maintenance — try again shortly
504Gateway TimeoutMemperbaiki galat 504 Gateway Timeout. Pelajari penyebab timeout upstream, konfigurasi proxy, dan pemecahan masalah.Contoh
→ REQUEST
GET /news HTTP/1.1 Host: example.com
505HTTP Version Not SupportedMemperbaiki galat 505 HTTP Version Not Supported. Pelajari ketidakcocokan versi protokol dan kompatibilitas server.Contoh
→ REQUEST
GET / HTTP/2 Host: example.com
506Variant Also NegotiatesMemahami 506 Variant Also Negotiates: referensi melingkar pada negosiasi konten transparan dan salah konfigurasi server.Contoh
→ REQUEST
GET /docs HTTP/1.1 Host: example.com Accept: text/html, application/xhtml+xml
507Insufficient StorageMemperbaiki galat 507 Insufficient Storage. Memahami batas penyimpanan WebDAV, bedanya dengan 413, dan solusinya.Contoh
→ REQUEST
PUT /docs HTTP/1.1 Host: example.com Content-Type: application/pdf Content-Length: 10000 <PDF file included in message body>
508Loop DetectedMemperbaiki galat 508 Loop Detected. Memahami perulangan tak terbatas pada WebDAV dan pemecahan masalah batas sumber daya cPanel.Contoh
→ REQUEST
PROPFIND /shared/ HTTP/1.1 Host: example.com Depth: infinity Content-Type: application/xml
510Not ExtendedMemahami 510 Not Extended: HTTP Extension Framework yang sudah usang, status historisnya, dan pemakaiannya.Contoh
→ REQUEST
GET /resource HTTP/1.1 Host: example.com
511Network Authentication RequiredMemperbaiki galat 511 Network Authentication Required. Memahami captive portal, halaman login Wi-Fi, dan penanganan di sisi klien.Contoh
→ REQUEST
GET / HTTP/1.1 Host: example.com