Package io.micronaut.http.netty
Interface NettyHttpRequestBuilder
- All Known Implementing Classes:
AbstractNettyHttpRequest,NettyClientHttpRequest,NettyHttpRequest
Common interface for client and server to implement to construct the Netty versions of the request objects.
- Since:
- 2.0.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescriptionstatic NettyHttpRequestBuilderasBuilder(HttpRequest<?> request) Transform the given request to an equivalentNettyHttpRequestBuilder, so that it can be transformed to a netty request.Directly convert this request body to aByteBody, if possible.default booleanisStream()Deprecated, for removal: This API element is subject to removal in a future version.default @NonNull io.netty.handler.codec.http.FullHttpRequestDeprecated.default @NonNull io.netty.handler.codec.http.HttpRequestDeprecated, for removal: This API element is subject to removal in a future version.Go throughtoHttpRequestDirect()andtoHttpRequestWithoutBody()insteadstatic @NonNull io.netty.handler.codec.http.HttpRequesttoHttpRequest(HttpRequest<?> request) Deprecated, for removal: This API element is subject to removal in a future version.Go throughtoHttpRequestDirect()andtoHttpRequestWithoutBody()insteadDeprecated.Go throughtoHttpRequestWithoutBody()andbyteBodyDirect()instead@NonNull io.netty.handler.codec.http.HttpRequestConvert this request to a netty request without the body.default @NonNull StreamedHttpRequestDeprecated, for removal: This API element is subject to removal in a future version.Go throughtoHttpRequestDirect()andtoHttpRequestWithoutBody()instead
-
Method Details
-
toFullHttpRequest
@Deprecated @NonNull default @NonNull io.netty.handler.codec.http.FullHttpRequest toFullHttpRequest()Deprecated.Converts this object to a full http request.- Returns:
- a full http request
-
toStreamHttpRequest
@Deprecated(since="4.0.0", forRemoval=true) @NonNull default @NonNull StreamedHttpRequest toStreamHttpRequest()Deprecated, for removal: This API element is subject to removal in a future version.Go throughtoHttpRequestDirect()andtoHttpRequestWithoutBody()insteadConverts this object to a streamed http request.- Returns:
- The streamed request
-
toHttpRequest
@NonNull @Deprecated(since="4.0.0", forRemoval=true) default @NonNull io.netty.handler.codec.http.HttpRequest toHttpRequest()Deprecated, for removal: This API element is subject to removal in a future version.Go throughtoHttpRequestDirect()andtoHttpRequestWithoutBody()insteadConverts this object to the most appropriate http request type.- Returns:
- The http request
-
toHttpRequestDirect
@Deprecated @NonNull default @NonNull Optional<io.netty.handler.codec.http.HttpRequest> toHttpRequestDirect()Deprecated.Go throughtoHttpRequestWithoutBody()andbyteBodyDirect()insteadDirectly convert this request to netty, including the body, if possible. If the body of this request has been changed, this will return an empty value.- Returns:
- The request including the body
-
byteBodyDirect
Directly convert this request body to aByteBody, if possible. If the body of this request has been changed, this will return an empty value.- Returns:
- The body
-
toHttpRequestWithoutBody
Convert this request to a netty request without the body. The caller will handle adding the body.- Returns:
- The request excluding the body
-
isStream
Deprecated, for removal: This API element is subject to removal in a future version.Go throughtoHttpRequestDirect()andtoHttpRequestWithoutBody()instead- Returns:
- Is the request a stream.
-
toHttpRequest
@Deprecated(since="4.0.0", forRemoval=true) @NonNull static @NonNull io.netty.handler.codec.http.HttpRequest toHttpRequest(@NonNull HttpRequest<?> request) Deprecated, for removal: This API element is subject to removal in a future version.Go throughtoHttpRequestDirect()andtoHttpRequestWithoutBody()insteadConvert the given request to a full http request.- Parameters:
request- The request- Returns:
- The full request.
-
asBuilder
Transform the given request to an equivalentNettyHttpRequestBuilder, so that it can be transformed to a netty request.- Parameters:
request- The micronaut http request- Returns:
- The builder for further operations
-
toHttpRequestDirect()andtoHttpRequestWithoutBody()instead