0

it is my first stab at Python. I'm using 3.10 (current stable version for Windows). My problem at hand : a) to make a call to rest api and to confirm connection is/was successful.

I have already followed this link : How to save a file to a specific directory in python?

and will share my code that I have tried below. AND I was actually running my script on Python terminal vs on CMD . I'm now running the below script on CMD.

import requests
import base64
pat = "where do I put user name and password"
authorization = str(base64.b64encode(bytes(':'+pat, 'ascii')), 'ascii')
url="hhttps://FileStorage/MARKETING/"

so Question 1) how do I connect correctly to the url provided I pass the correct/pw .

thanks and fire away with more questions/ details that is required.

junketsu
  • 533
  • 5
  • 17
  • thank you. I have updated my question , title around same. – junketsu Apr 25 '22 at 15:25
  • You're going to have to share the URL you're trying to connect to, or if it's not public then share details about how the REST API authenticates its users. This should be clearly specified in the API documentation, but without more details your question can't be answered. – Pranav Hosangadi Apr 25 '22 at 15:27
  • Hi Pranav, sadly the URL is internal to firm. What business analyst has shared with me is a username and password (and the URL) . When I just put this in the browser I get a 401 authentication error; but no place to put the user/credz in . I also did clear my browser cache (as it was suggested option to allow access) ; but was worth a try as Chrome still does not offer any place I can put user/pw. – junketsu Apr 25 '22 at 15:38

0 Answers0