I have the same issue with not being able to deserialize the data in the web server code. I tried @GaelTadh and I did notice a difference with my body code and I can see how that code would work with a single param like the total hits.
My issue however is that I am looking at sending the records that came back in the search as I need to extract some information out of each document and perform some tasks on each one. Is there a way to JSONify the search results to accomplish this? Or is there a better way to do this via a transform or script?