Last Updated: February 25, 2016
· timusg

one liner accept all http server

netcat is swiss-army knife for TCP/IP, following command creates a http server, which can accept all requests with any http verb or paths and return 200 OK.

while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; echo foo; } | nc -l 80; done


curl -XPOST

helpful for stubbing external http service in need.