How can I return XML from boto calls?

前端 未结 1 767
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-30 13:54

I am using boto 2.32.1 with Python 2.7.6. I am having problems with the list_orders function of boto\'s mws modules to get the XML data of my Amazon orders.

Here is

相关标签:
1条回答
  • 2020-12-30 14:01

    I don't think there's an officially supported method to do this, but you can do this to get the raw XML response back easily:

    # Set up
    from boto.mws.connection import MWSConnection
    MWSConnection._parse_response = lambda s, x, y, z: z
    
    # Usage
    result = az.get_matching_product_for_id(MarketplaceId="ATVPDKIKX0DER",
                                                SearchIndex="Books",
                                                IdType="ASIN",
                                                IdList=[0439023521])
    # <?xml version="1.0"?>\n<GetMatchingProductForIdResponse xmlns...
    
    0 讨论(0)
提交回复
热议问题