I'm trying to create mock server. I can definitely code it myself, but I found that ncat
could be theoretically used for that. And this should be available to more users already than my new code... However:
If I start "server" like this:
ncat -v -l -p 5555 -c 'while true; do read i && echo [echo] $i; done'
and issue request like this:
curl localhost:5555 -X POST --data-binary 'test'
I'm getting this:
curl: (1) Received HTTP/0.9 when not allowed
ncat version is 7.80. Why am I getting http version this old? Is it normal or is it a problem on my side? How to fix it? I definitely cannot adapt curl part to accept obsoleted responses.
If it's not possible, can someone recommend existing working alternative to using nc to listen to incoming requests and apply some command to each one of them?
Aucun commentaire:
Enregistrer un commentaire