Hey guys im trying to create a api request from a script like this:
ticket = []
for x in result:
ticket.append(x)
for t in ticket:
sport = int(t['Sport'])
location = int(t['Location'])
league = str(t['League'])[1:].strip()
print(league)
x = requests.post('http://server1:5099/Leagues?alias={league}&sportId={sport}'.format(league=league.strip(),sport=sport))
print(x.status_code)
im getting 404 error an when im debugging the code i see that the league is printed like this: "'Spain Cup. Women'" i need to remove the white spaces and the quotes from the league string so that the api request will look like this:
http://server1:5099/Leagues?alias=SpainCup.Women&sportId=48242
Thanks!