每天下载一个外部托管和密码保护的xml文件到我们的web服务器- http


Daily download of an external hosted and password protected xml file to our webserver - http

这与下面的问题基本相同,但在我们的例子中,源是受密码保护的(用户名和密码)

每日XML's从固定的外部url下载到web服务器's

这是可能通过http吗?

如何编写这些东西?

需要什么类型的身份验证?如果有Apache的基本身份验证,那么您可以通过如下方式编写URL自动登录:

http://user: password@host.com/file.xml

简单的PHP示例:

<?php 
$content = file_get_contents('http://user:password@host.com/file.xml');
?>