Apache 2.4/PHP 7.2 has been set up on your computer,
If i type http: //localhost/hoge/logon.html into the browser URL specification frame of the terminal, the web page design will appear normally.

Although now, we have started an experiment to receive the response of the Web page on the terminal (Windows10x64) with TELNET at the command prompt. I'm disgusted by myself who faced development without understanding HTTP interaction ...

this article because of lack of understanding Even if I read it, I don't know what type of access is correct and continue to receive a "400 Bad Request" response.

The command I tried is a black screen after connecting with telnet localhost 80

GET /hoge/logon.html HTTP/1.0

I ’m hitting the enter key. What kind of command input method is the original one?

Thanks for your comments.

  • Answer # 1


    What command do you enter?

    That's correct, but the Apache server may not accept HTTP/1.0 or the behavior may be a little different. Try HTTP/1.1 and add aHost:field.

    GET /hoge/logon.html HTTP/1.1

    Host: localhost

    For the handling of versions and fields, we recommend that you refer to the RFC correctly.

    Hypertext Transfer Protocol-HTTP/1.0-rfc1945
    Hypertext Transfer Protocol-HTTP/1.1-rfc2616