How can a CGI program read the entire body of an HTTP request and output it? I’ve tried a number of things and this is what I’ve currently got:
and some funny stuff gets printed out near endCode:char temp[7];
char read[1000];
strcpy(temp ,getenv("CONTENT_LENGTH"));
int inputLength = atoi(temp);
cin.get(temp, sizeof(temp));//divide by size of character
fread( read, inputLength, 1, stdin );
cout << "Request body: " << read << "</p>\n";