def data(request, name, kind=None, source=None):
    kw = dict(
        name=name,
        kind=kind or default_kind,
    )

    if request.method == 'POST':
        metric = Metric.get(
            parameter=Parameter.get(**kw),
            source=Source.get(source),
        )
        raw = request.body.strip()
        for i, line in enumerate(raw.split('\n'), start=1):
            try:
                _store_line(metric, line, maybe_with_spaces=(kind == 'string'))
            except ValueError, value:
                msg = u'Invalid {}: {} at line #{}\n'.format(kind, value, i)
                return HttpResponseServerError(msg)
        return HttpResponse('OK\n')