我只想在 Windows 的 Anaconda Powershell 中获取我的 Ip 地址的输出。
curl https://ipinfo.io/ip
Run Code Online (Sandbox Code Playgroud)
给了我以下内容:
StatusCode : 200
StatusDescription : OK
Content : 22.031.123.456
RawContent : HTTP/...
...
...
...
...
Content-Type: text/html; charset=utf-8
Date: ...
Via:...
Forms : {}
Headers : {[..., *], [...], [...],
[..., ...}
Images : {}
InputFields : {}
Links : {}
ParsedHtml : ...
RawContentLength : ...
Run Code Online (Sandbox Code Playgroud)
如您所见,“内容”显示了我的 IP 地址。但是如果没有任何其他信息,我无法获得 IP 地址。
注意:“curl api.ipify.org”和“curl ipinfo.io/ip”和其他人正在做完全相同的事情。