Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-22 Thread Chris Angelico
On Wed, Apr 22, 2020 at 5:18 AM Barry Scott wrote: > In the case of the 401 you can read what it means here: > https://httpstatuses.com/401 > Or for a less technical (and far cuter) explanation: https://http.cat/401 ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-21 Thread Chris Angelico
On Wed, Apr 22, 2020 at 6:51 AM wrote: > > I'm pretty much there ; just have to account for other types of > Authentication. E.g., for NTLM, I have this: > > response.raise_for_status Be aware that this line of code won't actually do anything. That's a method. ChrisA --

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-21 Thread dcwhatthe
On Tuesday, April 21, 2020 at 4:38:52 PM UTC-4, Chris Angelico wrote: > On Wed, Apr 22, 2020 at 6:30 AM Barry Scott barr wrote: > > > > > > > > > On 21 Apr 2020, at 20:47, dc wrote: > > > > > > On Tuesday, April 21, 2020 at 3:16:51 PM UTC-4, Barry Scott wrote: > > >>> On 21 Apr 2020, at 18:11, dc

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-21 Thread dcwhatthe
On Tuesday, April 21, 2020 at 4:25:54 PM UTC-4, Barry Scott wrote: > > On 21 Apr 2020, at 20:47, dc wrote: > > > > On Tuesday, April 21, 2020 at 3:16:51 PM UTC-4, Barry Scott wrote: > >>> On 21 Apr 2020, at 18:11, dc wrote: > >>> > >>> On Tuesday, April 21, 2020 at 12:40:25 PM UTC-4, Dieter

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-21 Thread Chris Angelico
On Wed, Apr 22, 2020 at 6:30 AM Barry Scott wrote: > > > > > On 21 Apr 2020, at 20:47, dcwhat...@gmail.com wrote: > > > > On Tuesday, April 21, 2020 at 3:16:51 PM UTC-4, Barry Scott wrote: > >>> On 21 Apr 2020, at 18:11, dc wrote: > >>> > >>> On Tuesday, April 21, 2020 at 12:40:25 PM UTC-4,

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-21 Thread Barry Scott
> On 21 Apr 2020, at 20:47, dcwhat...@gmail.com wrote: > > On Tuesday, April 21, 2020 at 3:16:51 PM UTC-4, Barry Scott wrote: >>> On 21 Apr 2020, at 18:11, dc wrote: >>> >>> On Tuesday, April 21, 2020 at 12:40:25 PM UTC-4, Dieter Maurer wrote: dc wrote at 2020-4-20 14:48 -0700: > ...

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-21 Thread dcwhatthe
On Tuesday, April 21, 2020 at 3:16:51 PM UTC-4, Barry Scott wrote: > > On 21 Apr 2020, at 18:11, dc wrote: > > > > On Tuesday, April 21, 2020 at 12:40:25 PM UTC-4, Dieter Maurer wrote: > >> dc wrote at 2020-4-20 14:48 -0700: > >>> ... > >>> I tried telneting the landing page, i.e. without the

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-21 Thread Barry Scott
> On 21 Apr 2020, at 18:11, dcwhat...@gmail.com wrote: > > On Tuesday, April 21, 2020 at 12:40:25 PM UTC-4, Dieter Maurer wrote: >> dc wrote at 2020-4-20 14:48 -0700: >>> ... >>> I tried telneting the landing page, i.e. without the specific node that >>> requires the login. So e.g. >>> >>>

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-21 Thread dcwhatthe
On Tuesday, April 21, 2020 at 12:40:25 PM UTC-4, Dieter Maurer wrote: > dc wrote at 2020-4-20 14:48 -0700: > > ... > >I tried telneting the landing page, i.e. without the specific node that > >requires the login. So e.g. > > > >Telnet thissite.oh.gov 80 > > > >, but it returns a 400 Bad Request.

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-21 Thread Dieter Maurer
dcwhat...@gmail.com wrote at 2020-4-20 14:48 -0700: > ... >I tried telneting the landing page, i.e. without the specific node that >requires the login. So e.g. > >Telnet thissite.oh.gov 80 > >, but it returns a 400 Bad Request. Before that, the Telnet screen is >completely blank ; I have to

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread Eli the Bearded
In comp.lang.python, wrote: > On Monday, April 20, 2020 at 5:02:23 PM UTC-4, Eli the Bearded wrote: > > For an example, back to telnet again. > > > > $ telnet example.com 80 > > Trying 255.11.22.123... > > Connected to example.com > > Escape character is '^]'. > > GET /digest/ HTTP/1.1 > >

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread dcwhatthe
On Monday, April 20, 2020 at 5:02:23 PM UTC-4, Eli the Bearded wrote: > In comp.lang.python, dc wrote, in reply to me: > > "What do you think it is doing?" > > I thought the timeout was waiting for a successful connection. > > A successful *connection* and a successful *authentication* are >

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread Eli the Bearded
In comp.lang.python, wrote, in reply to me: > "What do you think it is doing?" > I thought the timeout was waiting for a successful connection. A successful *connection* and a successful *authentication* are different things. $ telnet example.com 80 Trying 255.11.22.123... Connected to

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread dcwhatthe
On Monday, April 20, 2020 at 3:56:46 PM UTC-4, dcwh...@gmail.com wrote: > On Monday, April 20, 2020 at 3:18:59 PM UTC-4, Eli the Bearded wrote: > > In comp.lang.python, dc wrote: > > > However, one of them immediately returns a 401. I'm using the exact > > > same credentials to check this site,

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread dcwhatthe
On Monday, April 20, 2020 at 3:18:59 PM UTC-4, Eli the Bearded wrote: > In comp.lang.python, dc wrote: > > However, one of them immediately returns a 401. I'm using the exact > > same credentials to check this site, as when loggin in. > > > > Also, interestingly, it returns the 401 right away.

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread Eli the Bearded
In comp.lang.python, wrote: > However, one of them immediately returns a 401. I'm using the exact > same credentials to check this site, as when loggin in. > > Also, interestingly, it returns the 401 right away. I tried setting the > timeout value for a ridiculously long time, but it passes

Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread dcwhatthe
I'm validating several sites in a row, and most of them connect successfully. However, one of them immediately returns a 401. I'm using the exact same credentials to check this site, as when loggin in. Also, interestingly, it returns the 401 right away. I tried setting the timeout value