public final class ByteArrayResponseConverterFunction extends Object implements ResponseConverterFunction
HttpResponse with
content-type: application/binary or content-type: application/octet-stream.| Constructor and Description |
|---|
ByteArrayResponseConverterFunction() |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
convertResponse(ServiceRequestContext ctx,
ResponseHeaders headers,
Object result,
HttpHeaders trailers)
Returns
HttpResponse instance corresponds to the given result. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfallthroughpublic HttpResponse convertResponse(ServiceRequestContext ctx, ResponseHeaders headers, Object result, HttpHeaders trailers) throws Exception
ResponseConverterFunctionHttpResponse instance corresponds to the given result.
Calls ResponseConverterFunction.fallthrough() or throws a FallthroughException if
this converter cannot convert the result to the HttpResponse.convertResponse in interface ResponseConverterFunctionheaders - The HTTP headers that you might want to use to create the HttpResponse.
The status of headers is HttpStatus.OK by default or
HttpStatus.NO_CONTENT if the annotated method returns void,
unless you specify it with StatusCode on the method.
The headers also will include a MediaType if
ServiceRequestContext.negotiatedResponseMediaType() returns it.
If the method returns HttpResult, this headers is the same headers from
HttpResult.headers()
Please note that the additional headers set by
ServiceRequestContext.addAdditionalResponseHeader(CharSequence, Object)
and AdditionalHeader are not included in this headers.result - The result of the service method.trailers - The HTTP trailers that you might want to use to create the HttpResponse.
If the annotated method returns HttpResult, this trailers is the same
trailers from HttpResult.trailers().
Please note that the additional trailers set by
ServiceRequestContext.addAdditionalResponseTrailer(CharSequence, Object)
and AdditionalTrailer are not included in this trailers.ExceptionCopyright © 2020 LeanCloud. All rights reserved.