data = f'\u007b"domainNames":{domain_list}\u007d'
response = requests.post(
'https://api.name.com/v4/domains:checkAvailability',
headers=headers, data=data, auth=auth)
The problem is that I'm trying to send a list in 'domain_list'. But it shows the following error:
{'message': 'Invalid Argument', 'details': 'Error occurred during parsing: Cannot decode json string.'}
when the strings inside the list are single-quoted (example: ['example1.com', 'example2.com']
). But if I post the request with double-quoted strings (i.e. ["example1.com", "example2.com"]
) I get the results fine. Since I am loading the domain names from a file, is there a way to get double-quoted strings instead of single-quoted ones?