TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kaushik guru
NA
252
30.4k
Unable to pass variable from payload to url in python
Oct 5 2020 11:42 PM
I am trying to pass a params named ID in to a python api function from postman which will use the ID to call another api function inside the actual api
but the id field remains None in postman output
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.xxx.com/api/v1/target/id/None/id?isidRequired=True
this is my code
@D.route('/Checkcontactinfo/', methods=['GET'])
def checkcontact():
id = request.args.get('id')
ivurl: str = f'{xxx}/id/{id}/id?'
payload: Dict[str, Union[bool, int]] = {'isIDRequired': True,
'id':id}
response = get_iv_response(url=ivurl, payload=payload)
ID_contact_totalresult: int = response.get('totalResults')
return id_contact_totalresult
Reply
Answers (
2
)
how to save api output json as csv file
How can we add trailing zeroes to a number