Forums

using python requests to POST

Hi,

I am trying to use neverbounce to verify emails from user signup. They have CURL method to use :

curl -X POST -u <API USERNAME>:<API SECRET KEY> https://api.neverbounce.com/v3/access_token\
    -d grant_type=client_credentials\
    -d scope=basic+user

Is there a way to use requests.post for this?

Sure!

import requests

requests.post(
    "https://api.neverbounce.com/v3/access_token", 
    auth=('<API USERNAME>', '<API SECRET KEY>'),
    data={
        "grant_type": "client_credentials",
        "scope": "basic user",
    },
)