public final class HttpUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HttpUtil.Http2Error
All error codes identified by the HTTP/2 spec.
|
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_TYPE_GRPC
Content-Type used for GRPC-over-HTTP/2.
|
static Metadata.Key<String> |
CONTENT_TYPE_KEY
Metadata.Key for the Content-Type request/response header. |
static String |
HTTP_METHOD
The HTTP method used for GRPC requests.
|
static String |
TE_TRAILERS
The TE (transport encoding) header for requests over HTTP/2.
|
static String |
TIMEOUT
The Timeout header name.
|
static Metadata.Key<String> |
USER_AGENT_KEY
Metadata.Key for the Content-Type request/response header. |
Modifier and Type | Method and Description |
---|---|
static String |
getGrpcUserAgent(String transportName,
String applicationUserAgent)
Gets the User-Agent string for the gRPC transport.
|
static Status |
httpStatusToGrpcStatus(int httpStatusCode)
Maps HTTP error response status codes to transport codes.
|
public static final Metadata.Key<String> CONTENT_TYPE_KEY
Metadata.Key
for the Content-Type request/response header.public static final Metadata.Key<String> USER_AGENT_KEY
Metadata.Key
for the Content-Type request/response header.public static final String CONTENT_TYPE_GRPC
public static final String HTTP_METHOD
public static final String TE_TRAILERS
public static final String TIMEOUT
public static Status httpStatusToGrpcStatus(int httpStatusCode)