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

Peter Bengtsson mail@peterbe.com
Tue, 14 Jan 2003 21:14:25 +0000


At 09:35 2003-01-14 -0800, toman wrote:

>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.

Sidenote:

Most products inspect the REQUEST parameter.
Consider this method:

def manage_addMyProduct(self, id, title, REQUEST=None):
    foo = bar
    if REQUEST is not None:
        # method called via the web, then don't em' hanging here
        self.REQUEST.RESPONSE.redirect(somewhere)



>Also, when Zope has a fault on XMLRPC, should it be sending back
>that big 'Zope Error....' message, according to the XMLRPC spec?
>
>
>                                                 J. Toman
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://lists.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
>http://lists.zope.org/mailman/listinfo/zope-dev )