13, 10);
}
+gboolean
+zak_cgi_main_is_get (ZakCgiMain *zakcgimain)
+{
+ gboolean ret;
+
+ GHashTable *ht;
+
+ gchar *param;
+
+ ret = FALSE;
+
+ ht = zak_cgi_main_get_env (zakcgimain);
+ param = (gchar *)g_hash_table_lookup (ht, "REQUEST_METHOD");
+ if (param != NULL)
+ {
+ ret = (g_strcmp0 (param, "GET") == 0);
+ }
+
+ return ret;
+}
+
+gboolean
+zak_cgi_main_is_post (ZakCgiMain *zakcgimain)
+{
+ gboolean ret;
+
+ GHashTable *ht;
+
+ gchar *param;
+
+ ret = FALSE;
+
+ ht = zak_cgi_main_get_env (zakcgimain);
+ param = (gchar *)g_hash_table_lookup (ht, "REQUEST_METHOD");
+ if (param != NULL)
+ {
+ ret = (g_strcmp0 (param, "POST") == 0);
+ }
+
+ return ret;
+}
+
/* PRIVATE */
static void
zak_cgi_main_set_property (GObject *object,
void zak_cgi_main_redirect (const gchar *url);
+gboolean zak_cgi_main_is_get (ZakCgiMain *zakcgimain);
+gboolean zak_cgi_main_is_post (ZakCgiMain *zakcgimain);
+
G_END_DECLS
{
g_string_append_printf (str, "<br/><hr/>\n<table>\n");
+ g_string_append_printf (str,
+ "<tr><td>IS GET?</td><td>%s</td></tr>\n",
+ zak_cgi_main_is_get (NULL) ? "TRUE" : "FALSE");
+
+ g_string_append_printf (str,
+ "<tr><td>IS POST?</td><td>%s</td></tr>\n",
+ zak_cgi_main_is_post (NULL) ? "TRUE" : "FALSE");
+
g_hash_table_iter_init (&iter, ht);
while (g_hash_table_iter_next (&iter, &key, &value))
{
{
g_string_append_printf (str, "<table>\n");
+ g_string_append_printf (str,
+ "<tr><td>IS GET?</td><td>%s</td></tr>\n",
+ zak_cgi_main_is_get (NULL) ? "TRUE" : "FALSE");
+
+ g_string_append_printf (str,
+ "<tr><td>IS POST?</td><td>%s</td></tr>\n",
+ zak_cgi_main_is_post (NULL) ? "TRUE" : "FALSE");
+
g_hash_table_iter_init (&iter, ht_env);
while (g_hash_table_iter_next (&iter, &key, &value))
{