簡體   English   中英

通過 Python 請求調用 REST API 在 VPN 上不起作用

[英]REST API Call via Python requests does not work on VPN

我正在從 POSTMAN 和 Python(請求庫)調用 Informatica 的 REST API,發現這種行為很有趣。 當我使用 VPN 時,我只能從 POSTMAN 成功調用,但是如果我關閉 VPN,Python 和 POSTMAN 調用都可以正常工作。

由 POSTMAN 自動生成的 Python 腳本。

錯誤:

ConnectionError: HTTPSConnectionPool(host='use4-mdm.dm-us.informaticacloud.com', port=443): Max retries exceeded with url: /rdm-service/external/v2/export (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000002393AB297C0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

任何想法可能是什么原因?

UPD為了讓我的問題更清楚:

  1. 這是工作筆記本電腦上的企業 VPN

  2. 我的系統沒有 *_PROXY 變​​量

  3. 請求庫中沒有默認代理

     import requests session = requests.Session() session.proxies >>> {}
  4. http.client 庫 - 結果相同

  5. POSTMAN 中的設置在下面的屏幕截圖中

在此處輸入圖片說明

你可能想看看 python 請求的“代理”參數:)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM