p:http-request - base64 encoded response c:body

Hi all,

In Section 7.1.10.2 (c:body) we say:

"The encoding attribute controls the decoding of the element content for
formulating the body. A value of base64 indicates the element's content
is a base64 encoded string whose byte stream should be sent as the
message body. An implementation may support other encodings other that
base64 but these encodings and their names are implementation-defined."

And in 7.1.10.4 (Converting Response Entity Bodies) we say:

"For all other media types, the response is encoded as base64 (unless it
is encoded already) and then produced as text children of the c:body
element."


My question is: When creating response c:body elements that contain
base64 encoded content, should/must the processor always set the
"encoding" attribute to "base64", or is this optional since the media
type tells us enough as to what type of data c:body contains.

I would say that if the response c:body is base64 encoded, the
"encoding" attribute must always be set, otherwise the user of
p:http-request has to write some extra logic (using the content-type of
the c:body he gets) to detect whether to decode the data or not.


Regards,
Vojtech

Received on Thursday, 6 November 2008 11:21:01 UTC