Return-Path: Delivered-To: apmail-httpd-apreq-dev-archive@www.apache.org Received: (qmail 5023 invoked from network); 29 Mar 2009 12:53:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Mar 2009 12:53:36 -0000 Received: (qmail 99117 invoked by uid 500); 29 Mar 2009 12:53:35 -0000 Delivered-To: apmail-httpd-apreq-dev-archive@httpd.apache.org Received: (qmail 99076 invoked by uid 500); 29 Mar 2009 12:53:35 -0000 Mailing-List: contact apreq-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list apreq-dev@httpd.apache.org Received: (qmail 99068 invoked by uid 99); 29 Mar 2009 12:53:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Mar 2009 12:53:35 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.53.247.148] (HELO mx5.webfaction.com) (74.53.247.148) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Mar 2009 12:53:27 +0000 Received: by mx5.webfaction.com (Postfix, from userid 48) id 87F3D32E8141; Sun, 29 Mar 2009 07:53:03 -0500 (CDT) Received: from 212.76.37.148 (SquirrelMail authenticated user dsuch) by mail5.webfaction.com with HTTP; Sun, 29 Mar 2009 14:53:03 +0200 (CEST) Message-ID: <53905.212.76.37.148.1238331183.squirrel@mail5.webfaction.com> Date: Sun, 29 Mar 2009 14:53:03 +0200 (CEST) Subject: Parsing POST submitted XML with apreq2 From: "Dariusz Suchojad" To: apreq-dev@httpd.apache.org User-Agent: SquirrelMail/1.4.8-5.el5.centos.3 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Checked: Checked by ClamAV on apache.org Hello, I'm using apreq2 (Ubuntu Intrepid version 2.08-5build1) and I'm trying to parse the incoming POST submitted XML requests with it, however the very simple code below fails to build the body_table with APREQ_ERROR_NOPARSER. I've checked the latest SVN code and on one hand it seems apreq2 is trying to MIME-restrict itself to "application/x-www-form-urlencoded", "multipart/form-data" and "multipart/related" in library/parser.c:apreq_pre_initialize. Yet on the other hand there's a APREQ_DECLARE_HOOK(apreq_hook_apr_xml_parser) in the same source code file which is in use in library/t/parsers.c:parse_related. I haven't yet investigated it any closer but is what parse_related does the way to parse XML (both text/xml and application/xml) with apreq2? Can't it be done with apreq_body? Thanks for pointers! static int test_handle(request_rec *r) { if(!r->handler || strcmp(r->handler, "test")) { return DECLINED; } apreq_handle_t *req; const apr_table_t* body_table; apr_status_t status; req = (apreq_handle_t *)apreq_handle_apache2(r); status = apreq_body(req, &body_table); if(body_table != NULL) { /* Do something useful here */ } else { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, "body_table status [%d] [%d]", status, APREQ_ERROR_NOPARSER); } return OK; } -- Dariusz Suchojad gefira / the knowledge company http://www.gefira.pl Trackeria / online issue tracker https://www.trackeria.com