HTTP 200 OK vs gRPC 0 OK
HTTP 200 and gRPC OK both mean success, but gRPC OK travels inside an HTTP/2 200 response as a trailer. A gRPC call always returns HTTP 200 at the transport level — the actual success or failure is encoded in the grpc-status trailer, where 0 means OK.
Deskripsi
The request succeeded. The meaning depends on the HTTP method: GET returns the resource, POST reports the action result, HEAD returns headers only.
Ketika Anda Melihatnya
The most common HTTP response — indicates the request was processed successfully.
Cara Memperbaiki
No fix needed. The request succeeded as expected.
Deskripsi
The operation completed successfully. Not an error; returned on success.
Ketika Anda Melihatnya
The RPC completed without any issues. This is the expected response for every successful gRPC call.
Cara Memperbaiki
No fix needed — this indicates everything worked correctly.
Perbedaan Utama
HTTP 200 is the transport-level status; gRPC 0 OK is the application-level status in the grpc-status trailer.
A gRPC error (e.g., NOT_FOUND) still arrives as HTTP 200 — you must check the grpc-status trailer for the real status.
HTTP 200 implies the response body contains useful data; gRPC 0 OK means the protobuf response is valid.
gRPC uses HTTP/2 under the hood, so every gRPC call is technically an HTTP/2 request returning 200.
Monitoring gRPC services by HTTP status code alone will miss all gRPC errors — always check grpc-status.
Kapan Menggunakan Yang Mana
In HTTP REST APIs, return 200 for successful requests. In gRPC services, return status code 0 (OK) for successful RPCs. If you operate an API gateway that translates gRPC to HTTP, map gRPC 0 OK to HTTP 200 and ensure monitoring tools inspect grpc-status trailers, not just HTTP codes.