Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there more than GET or POST for HTTP?
    text
    copied!<p>I'm learning about writing Apache modules for a project I'm working on. I found the <a href="http://httpd.apache.org/docs/2.4/developer/" rel="nofollow">official guide</a>, which turns out to be <em>very</em> informative.</p> <p>On the first page, "<a href="http://httpd.apache.org/docs/2.4/developer/modguide.html" rel="nofollow">Developing modules for the Apache HTTP Server 2.4</a>", the section "Building a handler", subsection "The <code>request_rec</code> structure" provides some example code:</p> <pre><code>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, "&lt;h2&gt;Hello, %s!&lt;/h2&gt;", r-&gt;useragent_ip); /* If we were reached through a GET or a POST request, be happy, else sad. */ if ( !strcmp(r-&gt;method, "POST") || !strcmp(r-&gt;method, "GET") ) { ap_rputs("You used a GET or a POST method, that makes us happy!&lt;br/&gt;", r); } else { ap_rputs("You did not use POST or GET, that makes us sad :(&lt;br/&gt;", r); } /* Lastly, if there was a query string, let's print that too! */ if (r-&gt;args) { ap_rprintf(r, "Your query string was: %s", r-&gt;args); } return OK; } </code></pre> <p>Something that caught my eye was the <code>strcmp</code> on <code>r-&gt;method</code> to see if it's <code>POST</code>, <code>GET</code>, or <em>something else</em>. That's weird. I thought the only HTTP methods were <code>GET</code> and <code>POST</code>? Is there something else, or just the developers (or documentors) being unneedingly cautious?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload