[英]php http request to get .text response
是否可以访问服务器“ B”中的文件(.txt)作为使用php从服务器“ A”发送的HTTP请求的响应? 您能否为http请求指定相同的http请求的“响应类型”?
提前致谢
不是直接的(那将是巨大的安全风险)。
但是,如果您在服务器B上有一个脚本可以接受来自服务器A的请求,则它可以很简单:
服务器A请求: 此处
然后,从服务器B中,您只需提取该文件并返回它(如果愿意,可以使用适当的标头)。
但是请务必确保您不允许使用任何名称。 我建议您将请求限制为某些目录。 为什么? 因为您不希望有趣的文件名到达分配的目录之外。
加法: 这里
这是获取内容的有用功能。
[英]How to get HTTP response in a php request
[英]PHP HTTP request to get JSON response
[英]PHP get response time and http status code same request
[英]how to make a http request and get response using php
[英]HTTP POST/GET request to PHP script and JSON response
[英]AWS S3 SDK for PHP 2 - Get HTTP Request/Response Strings
[英]PHP Asynchronous HTTP request with response
[英]how to get response of http request
[英]response bad request in http request with php
[英]Get response text back from php after ajax request
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.