import requests


def queryUniprot(accessionList, resFormat = "xml"):
    """
    Retrieve list of accessions from Uniprot in specific format
    resFormat - the resulting format as in Uniprot API
    """
    params = {
        'from': 'ACC',
        'to': 'ACC',
        'format': resFormat,
        'query':' '.join(accessionList)
        }

    return requests.post('https://www.uniprot.org/uploadlists/', params)