May-05-2020, 02:36 PM
I am doing a get request for the api call to verify the values but I am having assert error due to white space \n which is in the json api call. How to handle this? I tired everything possible to replace and string command.
with open(“file.csv", "r") as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
next(csv_reader)
for lines in csv_reader:
indi = lines[0]
resource_type = lines[1]
source = lines[3]
name = lines[4]
response = requests.get(
'https://api.somewebsite + indi).json()
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(json.dumps(response,indent=4))
