I am testing my pset6 code but it is given an error of 405 method not allowed and I do not understand why? Please help me !! Thank you in advance!
//define elements to be checked
int length = strlen(line);
char method_checker[4];
method_checker[4]= '\0';
//Check if method is get
for (int i=0; i<3;i++){
strcpy(method_checker, &line[i]);
}
//continue man page http://www.tutorialspoint.com/cprogramming/c_continue_statement.htm
if (strcmp(method_checker, "GET") != 0) {
error(405);
continue;
}
The error is:
GET /cat.jpg HTTP/1.1
HTTP/1.1 405 Method Not Allowed