Package io.servicetalk.http.api
Interface HttpSerializer2<T>
- Type Parameters:
T- The type of objects to serialize.
- All Known Subinterfaces:
HttpSerializer<T>,HttpSerializerDeserializer<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A factory to address serialization concerns for HTTP request/response payload bodies.
-
Method Summary
Modifier and TypeMethodDescriptionserialize(HttpHeaders headers, T value, BufferAllocator allocator) Serialize an object of typeHttpSerializer2into aBuffer.
-
Method Details
-
serialize
Serialize an object of typeHttpSerializer2into aBuffer. If necessary theHttpHeadersshould be updated to indicate the content-type.- Parameters:
headers- TheHttpHeadersassociated with the serialization operation.value- The object to serialize.allocator- TheBufferAllocatorused to create the returnedBuffer.- Returns:
- The result of the serialization operation.
-