HTTP DOCS
HTTP-METHODS
Name
Description
Example
Output
GETDescription: Mengambil representasi resource. Hanya mengambil data, tidak mengubah state. Aman dan idempoten.
Example:
GET /api/users HTTP/1.1 Host: example.com
Output: 200 OK
[{...}, {...}]
GETMengambil representasi resource. Hanya mengambil data, tidak mengubah state. Aman dan idempoten.
GET /api/users HTTP/1.1 Host: example.com
200 OK
[{...}, {...}]
POSTDescription: Membuat resource baru. Tidak aman, tidak idempoten.
Example:
POST /api/users HTTP/1.1
Content-Type: application/json
{"name":"Ridho"}Output: 201 Created
Location: /api/users/123
POSTMembuat resource baru. Tidak aman, tidak idempoten.
POST /api/users HTTP/1.1
Content-Type: application/json
{"name":"Ridho"}201 Created
Location: /api/users/123
PUTDescription: Mengganti seluruh resource atau membuat jika belum ada. Idempoten.
Example:
PUT /api/users/123 HTTP/1.1
Content-Type: application/json
{"name":"Ridho","age":30}Output: 200 OK (atau 204 No Content)
PUTMengganti seluruh resource atau membuat jika belum ada. Idempoten.
PUT /api/users/123 HTTP/1.1
Content-Type: application/json
{"name":"Ridho","age":30}200 OK (atau 204 No Content)
PATCHDescription: Memperbarui sebagian resource. Tidak idempoten (bisa idempoten tergantung implementasi).
Example:
PATCH /api/users/123 HTTP/1.1
Content-Type: application/json
{"age":31}Output: 200 OK
PATCHMemperbarui sebagian resource. Tidak idempoten (bisa idempoten tergantung implementasi).
PATCH /api/users/123 HTTP/1.1
Content-Type: application/json
{"age":31}200 OK
DELETEDescription: Menghapus resource. Idempoten.
Example:
DELETE /api/users/123 HTTP/1.1
Output: 204 No Content
DELETEMenghapus resource. Idempoten.
DELETE /api/users/123 HTTP/1.1
204 No Content
HEADDescription: Sama seperti GET tetapi hanya mengembalikan header, tanpa body. Aman dan idempoten.
Example:
HEAD /api/users HTTP/1.1
Output: 200 OK (hanya header)
HEADSama seperti GET tetapi hanya mengembalikan header, tanpa body. Aman dan idempoten.
HEAD /api/users HTTP/1.1
200 OK (hanya header)
OPTIONSDescription: Mendeskripsikan opsi komunikasi untuk resource target. Digunakan untuk CORS preflight.
Example:
OPTIONS /api/users HTTP/1.1
Output: 204 No Content
Allow: GET, POST, OPTIONS
OPTIONSMendeskripsikan opsi komunikasi untuk resource target. Digunakan untuk CORS preflight.
OPTIONS /api/users HTTP/1.1
204 No Content
Allow: GET, POST, OPTIONS
TRACEDescription: Melakukan loop-back test di sepanjang jalur ke resource. Jarang digunakan, sering dinonaktifkan.
Example:
TRACE /api/users HTTP/1.1
Output: 200 OK (echo request)
TRACEMelakukan loop-back test di sepanjang jalur ke resource. Jarang digunakan, sering dinonaktifkan.
TRACE /api/users HTTP/1.1
200 OK (echo request)
CONNECTDescription: Membuat terowongan ke server (biasanya untuk HTTPS melalui proxy).
Example:
CONNECT example.com:443 HTTP/1.1
Output: 200 Connection Established
CONNECTMembuat terowongan ke server (biasanya untuk HTTPS melalui proxy).
CONNECT example.com:443 HTTP/1.1
200 Connection Established
STATUS-CODES
Name
Description
Example
Output
1xx – InformationalDescription: Menandakan permintaan diterima dan dilanjutkan.
Example:
100 Continue, 101 Switching Protocols
Output: Respons sementara
1xx – InformationalMenandakan permintaan diterima dan dilanjutkan.
100 Continue, 101 Switching Protocols
Respons sementara
100 ContinueDescription: Klien harus melanjutkan permintaan atau mengabaikan respons ini jika sudah selesai.
Example:
HTTP/1.1 100 Continue
Output: Klien dapat mengirim body
100 ContinueKlien harus melanjutkan permintaan atau mengabaikan respons ini jika sudah selesai.
HTTP/1.1 100 Continue
Klien dapat mengirim body
101 Switching ProtocolsDescription: Server setuju untuk mengganti protokol sesuai permintaan klien (misal WebSocket).
Example:
HTTP/1.1 101 Switching Protocols Upgrade: websocket
Output: Koneksi berubah protokol
101 Switching ProtocolsServer setuju untuk mengganti protokol sesuai permintaan klien (misal WebSocket).
HTTP/1.1 101 Switching Protocols Upgrade: websocket
Koneksi berubah protokol
2xx – SuccessDescription: Permintaan berhasil diterima, dipahami, dan diterima.
Example:
200 OK, 201 Created, 204 No Content
Output: Berhasil
2xx – SuccessPermintaan berhasil diterima, dipahami, dan diterima.
200 OK, 201 Created, 204 No Content
Berhasil
200 OKDescription: Respons sukses standar untuk GET, PUT, atau PATCH.
Example:
HTTP/1.1 200 OK
Output: Body respons
200 OKRespons sukses standar untuk GET, PUT, atau PATCH.
HTTP/1.1 200 OK
Body respons
201 CreatedDescription: Resource baru berhasil dibuat (biasanya dari POST).
Example:
HTTP/1.1 201 Created Location: /users/123
Output: Lokasi resource baru
201 CreatedResource baru berhasil dibuat (biasanya dari POST).
HTTP/1.1 201 Created Location: /users/123
Lokasi resource baru
204 No ContentDescription: Sukses tetapi tidak ada konten di body (umum untuk DELETE).
Example:
HTTP/1.1 204 No Content
Output: Body kosong
204 No ContentSukses tetapi tidak ada konten di body (umum untuk DELETE).
HTTP/1.1 204 No Content
Body kosong
3xx – RedirectionDescription: Dibutuhkan aksi tambahan dari klien untuk menyelesaikan permintaan.
Example:
301 Moved Permanently, 302 Found, 304 Not Modified
Output: Redirect atau cache
3xx – RedirectionDibutuhkan aksi tambahan dari klien untuk menyelesaikan permintaan.
301 Moved Permanently, 302 Found, 304 Not Modified
Redirect atau cache
301 Moved PermanentlyDescription: Resource telah dipindahkan secara permanen ke URL baru. Klien harus menggunakan URL baru di masa depan.
Example:
HTTP/1.1 301 Moved Permanently Location: https://new.example.com/page
Output: Redirect permanen
301 Moved PermanentlyResource telah dipindahkan secara permanen ke URL baru. Klien harus menggunakan URL baru di masa depan.
HTTP/1.1 301 Moved Permanently Location: https://new.example.com/page
Redirect permanen
302 FoundDescription: Redirect sementara. Klien tetap menggunakan URL asli untuk permintaan berikutnya.
Example:
HTTP/1.1 302 Found Location: /login
Output: Redirect sementara
302 FoundRedirect sementara. Klien tetap menggunakan URL asli untuk permintaan berikutnya.
HTTP/1.1 302 Found Location: /login
Redirect sementara
304 Not ModifiedDescription: Resource tidak berubah sejak versi yang diminta. Klien dapat menggunakan versi cache.
Example:
HTTP/1.1 304 Not Modified
Output: Gunakan cache
304 Not ModifiedResource tidak berubah sejak versi yang diminta. Klien dapat menggunakan versi cache.
HTTP/1.1 304 Not Modified
Gunakan cache
307 Temporary Redirect / 308 Permanent RedirectDescription: Mirip 302/301 tetapi tidak mengubah metode HTTP (POST tetap POST).
Example:
HTTP/1.1 307 Temporary Redirect Location: /new-url
Output: Redirect dengan metode dipertahankan
307 Temporary Redirect / 308 Permanent RedirectMirip 302/301 tetapi tidak mengubah metode HTTP (POST tetap POST).
HTTP/1.1 307 Temporary Redirect Location: /new-url
Redirect dengan metode dipertahankan
4xx – Client ErrorDescription: Kesalahan di sisi klien.
Example:
400 Bad Request, 401 Unauthorized, 404 Not Found
Output: Error klien
4xx – Client ErrorKesalahan di sisi klien.
400 Bad Request, 401 Unauthorized, 404 Not Found
Error klien
400 Bad RequestDescription: Server tidak memahami permintaan karena sintaks yang salah.
Example:
HTTP/1.1 400 Bad Request
Output: Body kosong atau format salah
400 Bad RequestServer tidak memahami permintaan karena sintaks yang salah.
HTTP/1.1 400 Bad Request
Body kosong atau format salah
401 UnauthorizedDescription: Autentikasi diperlukan (belum login atau token salah).
Example:
HTTP/1.1 401 Unauthorized WWW-Authenticate: Bearer
Output: Harus menyertakan kredensial
401 UnauthorizedAutentikasi diperlukan (belum login atau token salah).
HTTP/1.1 401 Unauthorized WWW-Authenticate: Bearer
Harus menyertakan kredensial
403 ForbiddenDescription: Server memahami permintaan tetapi menolak mengotorisasi (akses ditolak).
Example:
HTTP/1.1 403 Forbidden
Output: Tidak ada izin
403 ForbiddenServer memahami permintaan tetapi menolak mengotorisasi (akses ditolak).
HTTP/1.1 403 Forbidden
Tidak ada izin
404 Not FoundDescription: Server tidak dapat menemukan resource yang diminta.
Example:
HTTP/1.1 404 Not Found
Output: Resource tidak ada
404 Not FoundServer tidak dapat menemukan resource yang diminta.
HTTP/1.1 404 Not Found
Resource tidak ada
429 Too Many RequestsDescription: Pengguna telah mengirim terlalu banyak permintaan dalam waktu tertentu (rate limiting).
Example:
HTTP/1.1 429 Too Many Requests Retry-After: 60
Output: Coba lagi nanti
429 Too Many RequestsPengguna telah mengirim terlalu banyak permintaan dalam waktu tertentu (rate limiting).
HTTP/1.1 429 Too Many Requests Retry-After: 60
Coba lagi nanti
5xx – Server ErrorDescription: Kesalahan di sisi server.
Example:
500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable
Output: Error server
5xx – Server ErrorKesalahan di sisi server.
500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable
Error server
500 Internal Server ErrorDescription: Kesalahan generik server yang tidak terduga.
Example:
HTTP/1.1 500 Internal Server Error
Output: Body error
500 Internal Server ErrorKesalahan generik server yang tidak terduga.
HTTP/1.1 500 Internal Server Error
Body error
502 Bad GatewayDescription: Server bertindak sebagai gateway/proxy dan menerima respons tidak valid dari upstream.
Example:
HTTP/1.1 502 Bad Gateway
Output: Upstream error
502 Bad GatewayServer bertindak sebagai gateway/proxy dan menerima respons tidak valid dari upstream.
HTTP/1.1 502 Bad Gateway
Upstream error
503 Service UnavailableDescription: Server sementara tidak tersedia (kelebihan beban atau maintenance).
Example:
HTTP/1.1 503 Service Unavailable Retry-After: 120
Output: Coba lagi nanti
503 Service UnavailableServer sementara tidak tersedia (kelebihan beban atau maintenance).
HTTP/1.1 503 Service Unavailable Retry-After: 120
Coba lagi nanti
GENERAL-HEADERS
Name
Description
Example
Output
Cache-ControlDescription: Mengontrol caching di browser dan CDN. Directives: max-age, no-cache, no-store, must-revalidate.
Example:
Cache-Control: public, max-age=31536000, immutable
Output: Di-cache 1 tahun
Cache-ControlMengontrol caching di browser dan CDN. Directives: max-age, no-cache, no-store, must-revalidate.
Cache-Control: public, max-age=31536000, immutable
Di-cache 1 tahun
ConnectionDescription: Mengontrol apakah koneksi jaringan tetap terbuka setelah transaksi selesai.
Example:
Connection: keep-alive
Output: Koneksi persisten
ConnectionMengontrol apakah koneksi jaringan tetap terbuka setelah transaksi selesai.
Connection: keep-alive
Koneksi persisten
DateDescription: Tanggal dan waktu saat pesan dibuat.
Example:
Date: Mon, 28 Jun 2025 12:00:00 GMT
Output: Timestamp
DateTanggal dan waktu saat pesan dibuat.
Date: Mon, 28 Jun 2025 12:00:00 GMT
Timestamp
Transfer-EncodingDescription: Bentuk encoding yang digunakan untuk mengirim body ke klien (chunked).
Example:
Transfer-Encoding: chunked
Output: Body dikirim bertahap
Transfer-EncodingBentuk encoding yang digunakan untuk mengirim body ke klien (chunked).
Transfer-Encoding: chunked
Body dikirim bertahap
REQUEST-HEADERS
Name
Description
Example
Output
AcceptDescription: Memberi tahu server tipe konten yang dapat diterima klien (MIME type).
Example:
Accept: application/json
Output: Prioritas JSON
AcceptMemberi tahu server tipe konten yang dapat diterima klien (MIME type).
Accept: application/json
Prioritas JSON
AuthorizationDescription: Kredensial autentikasi (Basic, Bearer token).
Example:
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Output: Token JWT
AuthorizationKredensial autentikasi (Basic, Bearer token).
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Token JWT
Content-TypeDescription: Tipe media dari body permintaan.
Example:
Content-Type: application/json
Output: Body dalam format JSON
Content-TypeTipe media dari body permintaan.
Content-Type: application/json
Body dalam format JSON
CookieDescription: Mengirim cookie yang tersimpan ke server.
Example:
Cookie: session_id=abc123; theme=dark
Output: Data cookie
CookieMengirim cookie yang tersimpan ke server.
Cookie: session_id=abc123; theme=dark
Data cookie
HostDescription: Nama domain server (wajib di HTTP/1.1).
Example:
Host: example.com
Output: Server target
HostNama domain server (wajib di HTTP/1.1).
Host: example.com
Server target
User-AgentDescription: Informasi tentang browser atau aplikasi klien.
Example:
User-Agent: Mozilla/5.0 ...
Output: Identitas klien
User-AgentInformasi tentang browser atau aplikasi klien.
User-Agent: Mozilla/5.0 ...
Identitas klien
RESPONSE-HEADERS
Name
Description
Example
Output
Access-Control-Allow-OriginDescription: Mengizinkan asal lintas domain untuk mengakses resource (CORS).
Example:
Access-Control-Allow-Origin: *
Output: Semua origin diizinkan
Access-Control-Allow-OriginMengizinkan asal lintas domain untuk mengakses resource (CORS).
Access-Control-Allow-Origin: *
Semua origin diizinkan
ETagDescription: Identifier versi resource untuk validasi cache.
Example:
ETag: "33a64df551..."
Output: Digunakan dengan If-None-Match
ETagIdentifier versi resource untuk validasi cache.
ETag: "33a64df551..."
Digunakan dengan If-None-Match
LocationDescription: URL untuk redirect atau resource yang baru dibuat.
Example:
Location: https://example.com/new-page
Output: URL tujuan
LocationURL untuk redirect atau resource yang baru dibuat.
Location: https://example.com/new-page
URL tujuan
Set-CookieDescription: Mengirim cookie ke klien untuk disimpan.
Example:
Set-Cookie: session=abc; Secure; HttpOnly; SameSite=Lax
Output: Cookie diset
Set-CookieMengirim cookie ke klien untuk disimpan.
Set-Cookie: session=abc; Secure; HttpOnly; SameSite=Lax
Cookie diset
WWW-AuthenticateDescription: Menunjukkan metode autentikasi yang diperlukan (bersama 401).
Example:
WWW-Authenticate: Bearer realm="API"
Output: Metode autentikasi
WWW-AuthenticateMenunjukkan metode autentikasi yang diperlukan (bersama 401).
WWW-Authenticate: Bearer realm="API"
Metode autentikasi
CORS
Name
Description
Example
Output
Same-Origin PolicyDescription: Batasan browser yang mencegah halaman mengakses resource dari origin berbeda (protocol, domain, port).
Example:
fetch('https://other.com/api') → diblokirOutput: Diblokir oleh browser
Same-Origin PolicyBatasan browser yang mencegah halaman mengakses resource dari origin berbeda (protocol, domain, port).
fetch('https://other.com/api') → diblokirDiblokir oleh browser
Simple RequestDescription: Request yang tidak memicu preflight: GET, POST, HEAD dengan content-type tertentu.
Example:
POST dengan Content-Type: application/x-www-form-urlencoded
Output: Langsung dikirim
Simple RequestRequest yang tidak memicu preflight: GET, POST, HEAD dengan content-type tertentu.
POST dengan Content-Type: application/x-www-form-urlencoded
Langsung dikirim
Preflight Request (OPTIONS)Description: Request pendahuluan untuk memeriksa izin CORS sebelum request sebenarnya.
Example:
OPTIONS /api HTTP/1.1 Access-Control-Request-Method: DELETE
Output: Respons berisi header izin
Preflight Request (OPTIONS)Request pendahuluan untuk memeriksa izin CORS sebelum request sebenarnya.
OPTIONS /api HTTP/1.1 Access-Control-Request-Method: DELETE
Respons berisi header izin
Access-Control-Max-AgeDescription: Berapa lama hasil preflight dapat di-cache (dalam detik).
Example:
Access-Control-Max-Age: 86400
Output: Cache 24 jam
Access-Control-Max-AgeBerapa lama hasil preflight dapat di-cache (dalam detik).
Access-Control-Max-Age: 86400
Cache 24 jam
CACHING-MECHANISMS
Name
Description
Example
Output
ETag / If-None-MatchDescription: Validasi cache: server mengirim ETag, klien mengirim If-None-Match. Jika cocok, server balas 304.
Example:
Request: If-None-Match: "abc" Response: 304 Not Modified
Output: Menghemat bandwidth
ETag / If-None-MatchValidasi cache: server mengirim ETag, klien mengirim If-None-Match. Jika cocok, server balas 304.
Request: If-None-Match: "abc" Response: 304 Not Modified
Menghemat bandwidth
Last-Modified / If-Modified-SinceDescription: Validasi berdasarkan waktu modifikasi terakhir.
Example:
Request: If-Modified-Since: Mon, 28 Jun 2025 10:00:00 GMT Response: 304 Not Modified
Output: Cache valid
Last-Modified / If-Modified-SinceValidasi berdasarkan waktu modifikasi terakhir.
Request: If-Modified-Since: Mon, 28 Jun 2025 10:00:00 GMT Response: 304 Not Modified
Cache valid
Cache-Control: no-storeDescription: Tidak menyimpan cache sama sekali. Setiap request harus ke server.
Example:
Cache-Control: no-store
Output: Cache dinonaktifkan
Cache-Control: no-storeTidak menyimpan cache sama sekali. Setiap request harus ke server.
Cache-Control: no-store
Cache dinonaktifkan
Cache-Control: no-cacheDescription: Boleh cache, tapi harus divalidasi ulang ke server sebelum digunakan.
Example:
Cache-Control: no-cache
Output: Validasi setiap kali
Cache-Control: no-cacheBoleh cache, tapi harus divalidasi ulang ke server sebelum digunakan.
Cache-Control: no-cache
Validasi setiap kali
AUTHENTICATION-SCHEMES
Name
Description
Example
Output
Basic AuthenticationDescription: Mengirim username:password dalam header Authorization, diencode base64.
Example:
Authorization: Basic dXNlcjpwYXNz
Output: Kredensial base64 (tidak aman tanpa HTTPS)
Basic AuthenticationMengirim username:password dalam header Authorization, diencode base64.
Authorization: Basic dXNlcjpwYXNz
Kredensial base64 (tidak aman tanpa HTTPS)
Bearer TokenDescription: Mengirim token (JWT, OAuth2) di header Authorization.
Example:
Authorization: Bearer eyJhbGciOi...
Output: Token terverifikasi
Bearer TokenMengirim token (JWT, OAuth2) di header Authorization.
Authorization: Bearer eyJhbGciOi...
Token terverifikasi
Digest AuthenticationDescription: Lebih aman dari Basic, tidak mengirim password secara langsung.
Example:
Authorization: Digest username="user", realm="API", nonce="..."
Output: Hash password
Digest AuthenticationLebih aman dari Basic, tidak mengirim password secara langsung.
Authorization: Digest username="user", realm="API", nonce="..."
Hash password
API KeyDescription: Mengirim kunci API di header kustom (X-API-Key) atau query parameter.
Example:
X-API-Key: sk_live_abc123
Output: API key terautentikasi
API KeyMengirim kunci API di header kustom (X-API-Key) atau query parameter.
X-API-Key: sk_live_abc123
API key terautentikasi
CONTENT-NEGOTIATION
Name
Description
Example
Output
Accept HeaderDescription: Klien memberitahu server tipe konten yang diinginkan (application/json, text/html).
Example:
Accept: application/json, text/html;q=0.9
Output: JSON diprioritaskan
Accept HeaderKlien memberitahu server tipe konten yang diinginkan (application/json, text/html).
Accept: application/json, text/html;q=0.9
JSON diprioritaskan
Accept-LanguageDescription: Klien memberitahu server bahasa yang diinginkan.
Example:
Accept-Language: id-ID, en;q=0.8
Output: Bahasa Indonesia diprioritaskan
Accept-LanguageKlien memberitahu server bahasa yang diinginkan.
Accept-Language: id-ID, en;q=0.8
Bahasa Indonesia diprioritaskan
Accept-EncodingDescription: Klien memberitahu server encoding konten yang didukung (gzip, deflate, br).
Example:
Accept-Encoding: gzip, deflate, br
Output: Brotli dipilih jika didukung
Accept-EncodingKlien memberitahu server encoding konten yang didukung (gzip, deflate, br).
Accept-Encoding: gzip, deflate, br
Brotli dipilih jika didukung
HTTP-VERSIONS
Name
Description
Example
Output
HTTP/1.0Description: Setiap request membuka koneksi baru. Header Host tidak wajib.
Example:
GET /page.html HTTP/1.0
Output: Koneksi langsung ditutup
HTTP/1.0Setiap request membuka koneksi baru. Header Host tidak wajib.
GET /page.html HTTP/1.0
Koneksi langsung ditutup
HTTP/1.1Description: Koneksi persisten (keep-alive), header Host wajib, chunked transfer.
Example:
GET /api HTTP/1.1 Host: example.com Connection: keep-alive
Output: Koneksi tetap terbuka
HTTP/1.1Koneksi persisten (keep-alive), header Host wajib, chunked transfer.
GET /api HTTP/1.1 Host: example.com Connection: keep-alive
Koneksi tetap terbuka
HTTP/2Description: Binary protocol, multiplexing (banyak request dalam satu koneksi), header compression, server push.
Example:
Semua request ke satu domain menggunakan satu koneksi TCP.
Output: Lebih cepat, lebih efisien
HTTP/2Binary protocol, multiplexing (banyak request dalam satu koneksi), header compression, server push.
Semua request ke satu domain menggunakan satu koneksi TCP.
Lebih cepat, lebih efisien
HTTP/3Description: Berbasis QUIC (UDP), tanpa head-of-line blocking, koneksi lebih cepat di jaringan lossy.
Example:
Alt-Svc: h3=":443"
Output: Koneksi QUIC
HTTP/3Berbasis QUIC (UDP), tanpa head-of-line blocking, koneksi lebih cepat di jaringan lossy.
Alt-Svc: h3=":443"
Koneksi QUIC
BEST-PRACTICES
Name
Description
Example
Output
Gunakan HTTPSDescription: Enkripsi semua komunikasi HTTP dengan TLS.
Example:
Server mendukung HTTPS dengan redirect HTTP ke HTTPS.
Output: Data aman
Gunakan HTTPSEnkripsi semua komunikasi HTTP dengan TLS.
Server mendukung HTTPS dengan redirect HTTP ke HTTPS.
Data aman
Gunakan HTTP/2 atau HTTP/3Description: Manfaatkan multiplexing untuk loading halaman lebih cepat.
Example:
Aktifkan HTTP/2 di web server (Nginx, Apache).
Output: Performa meningkat
Gunakan HTTP/2 atau HTTP/3Manfaatkan multiplexing untuk loading halaman lebih cepat.
Aktifkan HTTP/2 di web server (Nginx, Apache).
Performa meningkat
Gunakan metode HTTP dengan benarDescription: GET untuk mengambil, POST untuk membuat, PUT untuk mengganti, DELETE untuk menghapus.
Example:
Hindari GET untuk operasi yang mengubah data.
Output: RESTful API
Gunakan metode HTTP dengan benarGET untuk mengambil, POST untuk membuat, PUT untuk mengganti, DELETE untuk menghapus.
Hindari GET untuk operasi yang mengubah data.
RESTful API
Rate Limiting dengan 429Description: Batasi jumlah permintaan untuk mencegah abuse.
Example:
return 429 Too Many Requests dengan header Retry-After.
Output: Melindungi server
Rate Limiting dengan 429Batasi jumlah permintaan untuk mencegah abuse.
return 429 Too Many Requests dengan header Retry-After.
Melindungi server