Meta-variables and stdin bytes for three requests

A web server receives the three HTTP requests below. Each request is mapped to a C program in /cgi-bin/. For each request, enter the values of REQUEST_METHOD and QUERY_STRING exactly as the server sets them. Also enter the number of bytes the program should read from standard input. Bodies are shown exactly as transmitted, with no trailing newline.

Request lineBody sentREQUEST_METHODQUERY_STRINGBytes to read from stdin
GET /cgi-bin/search.cgi?q=tcp+ip&page=2none
POST /cgi-bin/order.cgi?lang=enitem=42&qty=3
POST /cgi-bin/login.cgi?next=%2Fhomeuser=ana&pw=a%26b

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More CGI Programming Questions: