Exemplo n.º 1
0
    def _process_response(self, response, parse_response=True):
        """Post processing of the response"""

        return Response(response,
                        verb=self.verb,
                        list_nodes=self._list_nodes,
                        datetime_nodes=self.datetime_nodes,
                        parse_response=parse_response)
Exemplo n.º 2
0
def response():

    xml = b'<?xml version="1.0" encoding="UTF-8"?><findItemsByProductResponse xmlns="http://www.ebay.com/marketplace/search/v1/services"><ack>Success</ack><version>1.12.0</version><timestamp>2014-02-07T23:31:13.941Z</timestamp><searchResult count="1"><item><name>Item Two</name></item></searchResult><paginationOutput><pageNumber>1</pageNumber><entriesPerPage>1</entriesPerPage><totalPages>90</totalPages><totalEntries>179</totalEntries></paginationOutput><itemSearchURL>http://www.ebay.com/ctg/53039031?_ddo=1&amp;_ipg=2&amp;_pgn=1</itemSearchURL></findItemsByProductResponse>'
    o = ResponseDataObject({'content': xml}, [])
    r = Response(o,
                 verb='findItemsByProduct',
                 list_nodes=[
                     'finditemsbyproductresponse.searchresult.item',
                     'finditemsbyproductresponse.paginationoutput.pagenumber'
                 ])
Exemplo n.º 3
0
    def process_response(self, parse_response=True):
        """Post processing of the response"""

        self.response = Response(self.response,
                                 verb=self.verb,
                                 list_nodes=self._list_nodes,
                                 datetime_nodes=self.datetime_nodes,
                                 parse_response=parse_response)

        # set for backward compatibility
        self._response_content = self.response.content

        if self.response.status_code != 200:
            self._response_error = self.response.reason