vib.d suppress 404 for no content written

aberba karabutaworld at gmail.com
Wed Feb 14 21:16:23 UTC 2018


On Wednesday, 14 February 2018 at 14:58:14 UTC, Seb wrote:
> On Wednesday, 14 February 2018 at 14:30:19 UTC, Nicholas Wilson 
> wrote:
>> I have an endpoint that is a post:
>>
>> void postStuff(HTTPServerRequest req, HTTPServerResponse res)
>> {
>>     // do some stuff with req
>>     res.statusCode = 200;
>> }
>>
>> I do not write anything to res (deliberately) but want to set 
>> the status code.
>>
>> However it returns 404, because no content is written.
>> How can I make it return 200?
>>
>> FWIW its a member of a web interface class.
>>
>> Thanks
>> Nic
>
> You mean `writeVoidBody`
>
> See Also: https://github.com/vibe-d/vibe.d/issues/2065

Seb,  are you the one doing the vibe.d demo collections?


More information about the Digitalmars-d-learn mailing list