Hello all ,
Which is the recommended method to get the RequestEntity as String .
I tried two different paths:
(1)
Source<ByteString, Object> source = RequestEntity.getDataBytes();
I’m not sure what I’m supposed to do with the source
, it has a lot of methods, and it’s unclear how to use those and if any of them can actually help me.
(2)
Unmarshaller<HttpEntity, String> unmarshaller = Unmarshaller.entityToString();
CompletionStage result = unmarshaller.unmarshall(entity, ExecutionContext, Materializer);
Calling unmarshaller.unmarshall
requires not only an instance of RequestEntity
but also an ExecutionContext
and a Materializer
which I do not have at the part of the unmarshalling, also it returns a CompletionStage<String>
which is completely redundant as I want it to be done synced.
Can help me with some hints please ?
Many thanks in advance ,
Stefan
P.S is there any way to enable the debug messages of akka-http-server in order to see the flow of events and why at big requests the server hangs ?