Hello All, 

I am tying into someone's API, and their API calls a URL on my server
when it wants to send a message, it does this by posting an entry like:

-------------------------------------------------------------
Content-type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<MessageData>
    <SMSMessage id="123" originatingId="123" CarrierId="1"
        MappingId="ABC" MSISDN="61404111111" MessageType="TEXT">
        <MessageText>Sample Message</MessageText>
    </SMSMessage>
</MessageData>
-------------------------------------------------------------

Now, when my Apache::Request (or CGI::Query) object get instantiated, it
reads in the data from STDIN. I assume it expects data with the
content-type: application/x-www-form-urlencoded
as is indicative to me by the error i get in my logs:
-------------------------------------------------------------
[Wed Apr 14 10:26:12 2004] [error] [client ip-address-hidden] [libapreq]
unknown content-type: `text/xml; charset=UTF-8'
-------------------------------------------------------------

Also, doing a dumper on the query object shows content like: 

bless( {
                 '.charset' => 'ISO-8859-1',
                 '<?xml version' => [
                                      '"1.0" encoding="UTF-8"?>
<MessageData>
    <SMSMessage id="123" originatingId="123" CarrierId="1"
        MappingId="ABC" MSISDN="61404111111" MessageType="TEXT">
        <MessageText>Sample Message</MessageText>
    </SMSMessage>
</MessageData>
'
                                    ],
                 '.parameters' => [
                                    '<?xml version',
                                    'c',
                                    'mm_task'
                                  ],
                 '.fieldnames' => {},
                 'c' => [
                          'mm'
                        ],
                 'mm_task' => [
                                'api'
                              ]
               }, 'CGI' )

-------------------------------------------------------------

What i really want to do is read the raw data from STDIN
(as obviously its not in a format that Apache::Request or CGI::Query can
understand... or is it? because of the content-type set on the POST?)

Now, i don't know how to get to the STDIN, as it will have already been
read by the Apache::Request object... is there a function i can call on
the object to give me the "raw data"? 

I have tried searching the archives as i remember questions like this
coming but, up doing a search for "STDIN" on the 1.0 docs (as i use
mod_perl 1.x) did not yeild results that answered my question. 

Any help would be greatly appreciated, 

kind regards, 

simran.






-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to