netcat does not works in heredoc style -


i trying make request 1 of apache based web server using netcat. surprisingly following 2 formats work expected. style suggested on netcat manpage:

$printf "get / http/1.0\r\n\r\n" | nc 104.131.x.x 80 

and

$echo -e "get / http/1.0\r\n\r\n" | nc 104.131.x.x 80 

but, below 2 style such heredoc convention or line line command not work , responds 400 bad request.

$nc 104.131.x.x 80 <<eof > / http/1.0 >  >  > eof 

and

$nc 104.131.x.x 80 / http/1.0\r\n\r\n 

any idea, why similar header information acts differently?


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -