我有一个 https 链接,需要用户登录 & 密码。 如果我像这样在 FX 中运行它:
https://[电子邮件& nbsp; protected]/link/sublink
它将按预期返回 xml 数据。
然而,我想做的是自动化这个过程。
我尝试在 PHP 中使用 file_get_contents() 。
我什至尝试使用AJAX,但仍然不起作用。
我尝试在服务器或前端(ajax)中获取内容(XML),但两者都不起作用。
有谁知道我需要做什么才能获得内容? 我需要获取 SSL 证书吗?
任何其他语言的解决方案也将受到欢迎。
I have a https link that requires user login & password. If I run it in FX like this:
https://[email protected]/link/sublink
it will return the xml data as expected.
However, what i'm trying to do, is to automate this process.
I try to use file_get_contents() in PHP.
I even tried to use AJAX, but still doesn't work.
I tried to get the content (XML) either in Server or in the front-end (ajax), but both don't work.
Does anyone know what I need to go in order to get the content? Do I need to obtain the SSL certificate?
Solution in any ohter languages will be welcome too.
发布评论
评论(3)
通过其 libcurl java/" rel="nofollow noreferrer">Java 绑定。
Use libcurl via its Java bindings.
您应该使用curl库,如果您想防止中间人攻击,还应该验证证书。 或者使用curl 选项忽略它。
You should use curl library, also certificate should be verified if you want to prevent man-in-the-middle attacks. Or just ignore it using curl options.
支持 SSL 的 cURL 或 wget。
cURL,您可以通过编译的 PHP 库运行或从 PHP 调用可执行文件。
Wget,您将必须调用可执行文件。
cURL or wget with SSL support.
cURL, you can run either through the compiled PHP library or call the executable from PHP.
Wget, you will have to call the executable.