Click to See Complete Forum and Search --> : sending request with CGI


xoooa
04-16-2003, 10:03 AM
Hi all

I'm new with CGI, I"m testing a client-server connexion and I have to make my server able to receive a request (some data). The request is sent using a program writing with cURL and I need a CGI script on my server wich allow me to read the request and put the content on a file. I've searched on the web, all I've found is about form, but the one I need have to work without form. The request isn't sent from a web page.

Anyone has an idea?? Or can recommend me a document or some script??

Any comments will be greatly helpful.

Thanks a lot.

DaiWelsh
04-16-2003, 10:49 AM
It depends how the client is sending the request (I am not familiar with cURL). If it is using a standard HTTP request on the port that your website is running then it will look exactly the same as a request from a browser and all the code you have seen for handling browser submitted data will work.

If the client is sending on a different port or sending in a different format than HTTP then you may need to write your own low-level handler, either at the level of listening to a port (doing the job that the web server does on port 80 - HTTP) or just in terms of handling the data that is passed to you by the web server.

xoooa
04-17-2003, 03:54 AM
I was already able to get a web page from a server using cURL, and I could see this page stored on my folder. So I guess that cURL generate standard HTTP request, but still dont understand why my code does produce error segmentation after connecting to the server. Anyone has any idea ??

Thanks a lot.

DaiWelsh
04-17-2003, 08:04 AM
Would need more details about the exact nature of the request from curl and the error that it gets. Have you tried calling your script with a browser - you may get a more useful error that way?