@sachin123456 wrote:
I am trying like this - I have a rest API and using post method to call this API.
First I am trying to have authentication and later the body and the URL.import requests
import json
from requests.auth import HTTPBasicAuth
requests.get(‘url’, auth=HTTPBasicAuth(‘username’, ‘pass’))payload = {‘name’:‘rest_python’,‘domainId’:‘7319ca59-f9d4-4f86-9eaf-a359691b378b’,‘typeId’:‘00000000-0000-0000-0000-000000011001’}
response = requests.post(url, data=payload)print(response.text) #TEXT/HTML
print(response.status_code)it says
401what would be the issue here.
Thanks,
Sachin
Posts: 1
Participants: 1