V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
coltguo
V2EX  ›  问与答

关于 PHP 的 soket 发送 http 的问题

  •  
  •   coltguo · 2017-06-22 15:50:01 +08:00 · 1407 次点击
    这是一个创建于 2502 天前的主题,其中的信息可能已经有所发展或是发生改变。
    \n" ; }else{ $get = 'GET '.$fh['path'].' HTTP/1.1'.'\r\n'; $get .= 'Host: '.$fh['host'].'\r\n'; $get .= "Connection: Close\r\n\r\n" ; fwrite($conn,$get); while(!feof($conn)){ echo fgets ( $conn , 128 ); } fclose($conn); } 为什么运行出来,是出现如下错误 HTTP/1.0 400 Bad request Cache-Control: no-cache Connection: close Content-Type: text/html 400 Bad request Your browser sent an invalid request 求大神帮我看看
    2 条回复    2017-06-22 16:06:34 +08:00
    UnisandK
        1
    UnisandK  
       2017-06-22 15:51:24 +08:00
    \r\n ?
    coltguo
        2
    coltguo  
    OP
       2017-06-22 16:06:34 +08:00
    解决了,谢谢啦
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1370 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 17:22 · PVG 01:22 · LAX 10:22 · JFK 13:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.