Project

General

Profile

[Solved] Not able to send data from post query in lighttpd and read from stdin using cat

Added by vaibhov 3 months ago

Hello,

I am trying to send some data (raw or binary) using POST to my lighhtpd server using POSTMAN. But i am unable to receive any data at server side. I have tried to see the received data at server using UNIX script through CGI but it appears that there is no data at /dev/stdin. However data packets can be seen in wireshark. I have attached my lighttpd.conf and modules.conf.


Replies (4)

RE: Not able to send data from post query in lighttpd and read from stdin using cat - Added by gstrauss 3 months ago

I have attached my lighttpd.conf and modules.conf.

but you did not attach the CGI config. Please use lighttpd -p -f /path/to/your/lighttpd_ssip.conf

Are you sure that the CGI is being run?

RE: Not able to send data from post query in lighttpd and read from stdin using cat - Added by vaibhov 3 months ago

I have now attached my cgi file, here test is my custom binary in which i am able to print values of varibales eg. $HTTP_ACCEPT_LANGUAGE, "$CONTENT_LENGTH" etc. So the cgi is working fine.

index.cgi (189 Bytes) index.cgi

RE: Not able to send data from post query in lighttpd and read from stdin using cat - Added by vaibhov 3 months ago

I have attached the logs I get after using command:: lighttpd -p -f /path/to/your/lighttpd_ssip.conf

RE: Not able to send data from post query in lighttpd and read from stdin using cat - Added by gstrauss 3 months ago

I don't think that the test line in your index.cgi does what you think it does.

Try

#!/bin/sh
echo "Status: 200" 
echo "Content-Type: text/plain" 
echo
echo "Content-Length: $CONTENT_LENGTH" 

    (1-4/4)