[Zope] How can you tell it's XMLRPC ?

Dieter Maurer dieter@handshake.de
Wed, 15 Jan 2003 23:13:51 +0100


toman wrote at 2003-1-14 09:35 -0800:
 > Is there a way to distinguish whether a request was made from a browser 
 > (no, not a particular browser) or from XMLRPC ? I would like to be able
 > to tailor my responses to rpc requests so that I don't get a whole web 
 > page sent back when a value would do. Particularly, object creation code
 > usually refers back to the management page of it's container, which 
 > isn't the response I want for rpc, success or failure would be preferable.
Zope assumes an XMLRPC request iff "REQUEST_METHOD == 'POST'
and Content-Type == 'text/xml'".

You can access "REQUEST_METHOD" directly via "REQUEST" and
"content-type" via the "REQUEST" method "get_header".

 > Also, when Zope has a fault on XMLRPC, should it be sending back
 > that big 'Zope Error....' message, according to the XMLRPC spec?
I think, Casay changed this for Zope 2.6.


Dieter