나는 작업중인 프로젝트에 대해 아파치 모듈을 작성하는 방법을 배웠다. 나는 official guide을 찾았고 이 매우 유익한 것으로 판명되었습니다. 에 r->method
에 내 눈이 strcmp
이었다 잡은HTTP에 GET 또는 POST 이상 있습니까?
static int example_handler(request_rec *r)
{
/* Set the appropriate content type */
ap_set_content_type(r, "text/html");
/* Print out the IP address of the client connecting to us: */
ap_rprintf(r, "<h2>Hello, %s!</h2>", r->useragent_ip);
/* If we were reached through a GET or a POST request, be happy, else sad. */
if (!strcmp(r->method, "POST") || !strcmp(r->method, "GET")) {
ap_rputs("You used a GET or a POST method, that makes us happy!<br/>", r);
}
else {
ap_rputs("You did not use POST or GET, that makes us sad :(<br/>", r);
}
/* Lastly, if there was a query string, let's print that too! */
if (r->args) {
ap_rprintf(r, "Your query string was: %s", r->args);
}
return OK;
}
뭔가 : 첫 번째 페이지에서
는 " Developing modules for the Apache HTTP Server 2.4은"절 "핸들러를 구축", 하위는 "request_rec
구조는"몇 가지 예제 코드를 제공합니다
POST
,
GET
또는
인 경우인지 확인하십시오. 이상 하네. 유일한 HTTP 방법은
GET
과
POST
인 줄 알았습니까? 다른 것이 있습니까, 아니면 단지 개발자 (또는 문서 작성자)가 불필요하게 신중합니까?
http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods – Blender