Am 04.10.2014 12:50, schrieb Maaaks:

The form field has name="tags[]". Yes, it all looks formally correctly, but won't it be semantically more easy to understand that in this case, when browser sends multiple tags[], the server code will read it as a single array called tags?

The low-level code in HTTPServerRequest aims to closely represent what
is sent under the hood, so in this case it always works with single
string values, exactly like they get sent from the browser. But the
higher level framework in vibe.web.web allows to do this (from the top
of my head):

import vibe.web.web;

class MyWebService {
    // available as POST /form
    void postForm(string[] tags)
    {
        render!("some_template.dt", tags);
    }
}

All form fields named "tags" will then automatically be put into the
tags parameter (it still has to be name="tags" without the in the
"[]" in HTML, though).

If I understand correctly, this is the way that the arrays from forms are processed in PHP.

PHP seems to use the [] suffix to have a consistent way to make string
array keys work (arrayname[somekey]). For D with its strongly typed
arrays (that only support numeric indexes anyway) it seemed to be more
natural to just use the plain name.