import requests


def post_service_2_response(url, scale_key_pair):
    """Using the user entry for scale key-pair, we use this function to
    send a post request to s2, for a new note pitch.

    Keyword Arguments:
        url: The url of service 2.
        scale_key_pair: A key pair scale list dictionary.

    """

    service_2_response = requests.post(url, json=scale_key_pair)
    json_response_data = service_2_response.json()

    print("\n ----------- Service 2 POST Response ----------- \n")

    print(f'Service 2 Response: {service_2_response}')
    print(f'Response Code: {service_2_response.status_code}')
    print(f'Data: {json_response_data}')

    print("\n ----------- End of Service 2 POST Response ----------- \n")

    return json_response_data