p:http-request - duplication of information in c:multipart

Hi all,

Another p:http-request related question. When parsing multipart
responses and constructing the result c:multipart content, is it correct
to keep the boundary information in the content-type? Like this:

<c:multipart boundary="-=-=-=-" content-type="multipart/mixed;
boundary='-=-=-=-'">
...
</c:multipart>

Or should the result be:

<c:multipart boundary="-=-=-=-" content-type="multipart/mixed">
...
</c:multipart>

(The boundary information is removed from the content type).

Currently, the tests for p:http-request keep the boundary information in
the content-type, but I m not sure whether that is correct. If the
boundary information remains in the content-type, what happens if I
attempt to submit such data using another p:http-request? The answer is
probably obvious (it should work), but consider this:

<c:multipart boundary="-=-=-=-" content-type="multipart/mixed;
boundary='somethingelse'">
...
</c:multipart>

Which of the values takes precedence? Or is this an error (I would say
so)?

--

This is probably a more general problem, since similar things can happen
also elsewhere in c:multipart. For instance:

<c:multipart>
  <c:header name="Content-Type=" value="text/plain"/>
  <c:body content-type="application/xml">
    ..
  </c:body>
</c:multipart>

How is this handled when making the request?

Also, when parsing the response with multipart bodies, is the expected
result something like this:

<c:multipart>
  <c:header name="Content-Type=" value="application/xml"/>
  <c:body content-type="application/xml">
    ..
  </c:body>
</c:multipart>

Or this (content-type is not duplicated in the headers):

<c:multipart>
  <c:body content-type="application/xml">
    ..
  </c:body>
</c:multipart>

--

I always try to look at the results of p:http-request in terms of
'round-trippability': you should be able to use another p:http-request
to submit the results of a previous p:http-request (excluding some
obvious exceptional cases, of course). But I wonder: is this a right
view? 


Regards,
Vojtech

Received on Tuesday, 3 February 2009 08:16:27 UTC