Hi Vicki,
On Tue, Apr 28, 2015 at 10:19 PM, Vicki Le <
vi...@vicnle.com> wrote:
> This works but my responseAsString has a CDATA section in it with illegal
> XML characters within it. It looks like spray is ignoring the CDATA and
> escaping all the illegal XML characters. Is there a way to avoid this while
> keeping the media type as xml? I found that when i use text/plain, the
> response comes out the way I want it to.
If you create an HttpResponse manually like you do in the example, the
only thing that spray does in `HttpEntity.apply(ContentType, String)`
is applying the charset from the content type to encode the string to
create the binary data. Spray shouldn't touch the content in any way,
in particular it doesn't care if the content is XML or not (at least
in that code snippet).
So, I suspect the problem lies somewhere else. This could be either
the rest of your server code (do you use spray-routing?) or it could
also happen on the client which may interpret `application/xml` data
differently from `text/plain` data. Maybe you can show more code or a
data example which reproduces the problem?
Johannes
-----------------------------------------------
Johannes Rudolph
http://virtual-void.net