def format_signing_data(api_key_id, host, url, method):
    """ Format the input data for signing to the exact specification.

    Mainly, handles case-sensitivity where it must be handled.

    >>> format_signing_data('0123456789abcdef', 'veracode.com', '/home', 'GET')
    'id=0123456789abcdef&host=veracode.com&url=/home&method=GET'
    >>> format_signing_data('0123456789abcdef', 'VERACODE.com', '/home', 'get')
    'id=0123456789abcdef&host=veracode.com&url=/home&method=GET'
    """
    # Ensure some things are in the right case.
    # Note that path (url) is allowed to be case-sensitive (because path is sent along verbatim)
    # This is an HTTP fact, not a rule of our own design. stackoverflow.com/a/17113291/884640
    api_key_id = api_key_id.lower()
    host = host.lower()
    method = method.upper()

    # BTW we do not use a stdlib urlencode thing, because it is NOT exactly URL-encoded!
    return 'id={api_key_id}&host={host}&url={url}&method={method}'.format(api_key_id=api_key_id, host=host, url=url,
                                                                          method=method)