def Query(r, what, fields, qfilter=None):
    """
    Retrieves information about resources.

    @type what: string
    @param what: Resource name, one of L{constants.QR_VIA_RAPI}
    @type fields: list of string
    @param fields: Requested fields
    @type qfilter: None or list
    @param qfilter: Query filter

    @rtype: string
    @return: job id
    """
    body = {'fields': fields}
    if qfilter is not None:
        body['qfilter'] = body['filter'] = qfilter
    return r.request('put', '/2/query/%s' % what, content=body)
