Как получить доступ ко второй паре Set-Cookies в заголовке HTTP, используя python - PullRequest
0 голосов
/ 15 апреля 2020

Это вывод, когда я использую команду curl с терминала.

* Found bundle for host ******* [can pipeline]
* Could pipeline, but not asked to!
* Re-using existing connection! (#0) with host *********
* Connected to ************** port 443 (#0)
> GET /dashboard/auth/login/?next=/dashboard/ HTTP/1.1
> Host: ***********
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Wed, 15 Apr 2020 05:57:16 GMT
< Server: Apache/2.4.6 (Red Hat Enterprise Linux)
< Content-Language: en
< Expires: Wed, 15 Apr 2020 05:57:17 GMT
< Vary: Cookie,Accept-Language,Accept-Encoding
< Cache-Control: no-cache, no-store, must-revalidate, max-age=0
< X-Frame-Options: SAMEORIGIN
< Set-Cookie: csrftoken=do5sTx5yjANhraCREebttJEgVAuJGhzb; Path=/; secure
< Last-Modified: Wed, 15 Apr 2020 05:57:17 GMT
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=utf-8
< Strict-Transport-Security: max-age=63072000; includeSubDomains; preload;
< X-Content-Type-Options: nosniff
< Set-Cookie: SERVERID=************; path=/; Secure
<

, но последняя строка ie < Set-Cookie: SERVERID=************; path=/; Secure не отображается при использовании следующего python скрипт

import requests
url = '*********'
r = requests.get(url)
print(r.headers)

вывод

{'Date': 'Wed, 15 Apr 2020 09:00:25 GMT', 'Server': 'Apache/2.4.6 (Red Hat Enterprise Linux)', 'Content-Language': 'en', 'Expires': 'Wed, 15 Apr 2020 09:00:25 GMT', 'Vary': 'Cookie,Accept-Language,Accept-Encoding', 'Cache-Control': 'no-cache, no-store, must-revalidate, max-age=0', 'X-Frame-Options': 'SAMEORIGIN', 'Set-Cookie': 'csrftoken=KLQGVokcpW2BR4hUNrVwW6aNEBz5mixZ; Path=/; secure', 'Last-Modified': 'Wed, 15 Apr 2020 09:00:25 GMT', 'Content-Encoding': 'gzip', 'Content-Length': '3095', 'Content-Type': 'text/html; charset=utf-8', 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload;', 'X-Content-Type-Options': 'nosniff'}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...