CVu, Code Critique, and D
Steven Schveighoffer
schveiguy at yahoo.com
Tue Jun 19 13:55:34 UTC 2018
On 6/19/18 9:43 AM, Anton Fediushin wrote:
> On Tuesday, 19 June 2018 at 08:56:05 UTC, Russel Winder wrote:
>> I would like to build a back-end server that performs some processing
>> on the body of the HTTP request it receives. To begin with, I would
>> like it to simply echo the request body back to the client.
>
> There is vibe.web.rest which covers 90% of everything one might need for
> their back-end application. There's practically no reason to bother with
> bodyReaders/Writers.
The one reason I found is that the REST interface must serialize
everything before returning.
For example, if you are looking for ALL the data from your database,
instead of streaming it while parsing the database, you have to
serialize the entire database to an in-memory array, and return that,
which the REST interface will then serialize to JSON.
In my case, I had to output the data manually to avoid insane memory
consumption.
-Steve
More information about the Digitalmars-d
mailing list