How to call rest API using python selenium?



  • I have a scenario where I need to call a rest API in my python selenium script but I am not sure how to do it.

    If anyone as idea on it can you please help me out .

    The API used is to delete the phone number.



  • Request is the Python built-in HTTP library.

    r = requests.get('https://api.github.com/user', auth=('user', 'pass'))
    print( r.status_code ) # Print 200
    

    If you want to systematic valid Rest Endpoints, you may want to look at pyresttest or Tavern.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2