我使用 httpful 发送 http 请求并获取响应以显示在 request.php
include('httpful.phar');
$response = \Httpful\Request::get('http://domain/response.php')->send();
echo '<textarea rows="20" cols="100">';
echo $response;
echo '</textarea>';
在 response.php 中,我使用 header 将请求重定向到另一个页面,但我无法获得预期的响应。
header("HTTP/1.1 301 Moved Permanently");
header("Location:http://otherdomain/other_response.php");
echo 'internal response page'
我也试过
header("HTTP/1.1 302 Found");
但它仍然只得到响应“内部响应页面”
将请求重定向/转发到 other_response.php 的正确方法是什么?