http://www.perlmonks.org?node_id=1045617


in reply to Re: Decode perl cgi response in C
in thread Decode perl cgi response in C

Yes...I think what it is telling me is to download a small file containing the text response. I tried an example in firefox and I got a prompt...Do you want to download test2.cgi? When I downloaded the file, it contained the desired text. "Hello". With my embedded system, I don't want to download a file...I just want to read the text it contains. Is that possible? I have a small perl client that just prints the response, so I would like to replicate this in C.

Replies are listed 'Best First'.
Re^3: Decode perl cgi response in C
by Corion (Patriarch) on Jul 22, 2013 at 10:56 UTC

    Maybe you want to learn about "sockets"? I assume that Unix Network Programming still is the authoritative book about this.

    Basically, a "socket" is like a "file", except you can't seek on it, and it goes over the network. From C, you can read/write the socket and you only need to know about the protocol that is spoken over that socket.

    The basic idea is that "download data" vs. "read data" is only a frontend issue and exists only for users, not for programs.