def create_ondemand_streaming_locator(access_token, encoded_asset_id, pid, starttime=None):
path = '<STR_LIT>'<EOL>endpoint = '<STR_LIT>'.join([ams_rest_endpoint, path])<EOL>if starttime is None:<EOL><INDENT>body = '<STR_LIT>' + pid + '<STR_LIT>' + encoded_asset_id + '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>body = '<STR_LIT>' + pid + '<STR_LIT>' + encoded_asset_id + '<STR_LIT>' + str(starttime) + '", \ Type": "2" \<DEDENT>return do_ams_post(endpoint, path, body, access_token, "<STR_LIT>")<EOL>
Create Media Service OnDemand Streaming Locator.

    Args:
        access_token (str): A valid Azure authentication token.
        encoded_asset_id (str): A Media Service Encoded Asset ID.
        pid (str): A Media Service Encoded PID.
        starttime (str): A Media Service Starttime.

    Returns:
        HTTP response. JSON body.