func (sr *swarmRouter) createConfig(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
    var config types.ConfigSpec
    if err := httputils.ReadJSON(r, &config); err != nil {
        return err
    }