Both @Stefan's links are broken, so decided to write the answer I found from research:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
printf("Content-Type: text/plain\n\nHello world!\n");
const char *method_str = getenv("REQUEST_METHOD");
for(register unsigned short i=argc; i>0;) {
--i; printf("argv[%d]=%s ", i, argv[i]);
}
printf("REQUEST_METHOD = %s", method_str);
}