I need to write a custom MessageBodyReader (and MessageBodyWriter, this already works) to handle the TBytes type, such that this particular dynamic array type would be treated as a byte stream. This gives the ability to pass/return TBytes to/from a resource declared as consuming/producing a TMediaType.APPLICATION_OCTET_STREAM, without the need to create and having to deal with TMemoryStream (which seems to be the only currently/natively supported type when consuming/producing TMediaType.APPLICATION_OCTET_STREAM).
In reference to the following TODO:
|
// TODO: Modify, try first GetObjectFromParam (to rename!) and then GetSimpleParam |
The current code actually inhibits the ability to write such a custom MessageBodyReader for the TBytes type, which is a dynamic array and these are treated by special code that doesn't use the MessageBodyReader registry. Solving this TODO would probably solve my issue (well, I tried and it actually solves it, but I can't foresee the drawbacks).
I need to write a custom MessageBodyReader (and MessageBodyWriter, this already works) to handle the
TBytestype, such that this particular dynamic array type would be treated as a byte stream. This gives the ability to pass/returnTBytesto/from a resource declared as consuming/producing aTMediaType.APPLICATION_OCTET_STREAM, without the need to create and having to deal withTMemoryStream(which seems to be the only currently/natively supported type when consuming/producingTMediaType.APPLICATION_OCTET_STREAM).In reference to the following TODO:
WiRL/Source/Core/WiRL.Core.Application.Worker.pas
Line 396 in e72dad1
The current code actually inhibits the ability to write such a custom MessageBodyReader for the
TBytestype, which is a dynamic array and these are treated by special code that doesn't use the MessageBodyReader registry. Solving this TODO would probably solve my issue (well, I tried and it actually solves it, but I can't foresee the drawbacks).