예제 #1
0
    def execute(self, chain, request, env={}):
        if "payload" in env:
            marshaller = Converters.marshaller_for(request.headers.get("Content-type"))
            env["body"] = marshaller.marshal(env["payload"])
            del (env["payload"])

        return chain.follow(request, env)
예제 #2
0
    def execute(self, chain, request, env={}):
        if "payload" in env:
            content_type = request.headers.get("Content-Type")
            marshaller = Converters.marshaller_for(content_type)
            env["body"] = marshaller.marshal(env["payload"])
            del (env["payload"])

        return chain.follow(request, env)
예제 #3
0
    def resource(self):

        if 'content-type' in self.response[0]:
            contenttype = self.response[0]['content-type'].split(';')[0]
        else:
            contenttype = None

        converter = Converters.marshaller_for(contenttype)
        return converter.unmarshal(self.body)
예제 #4
0
    def resource(self):

        if "content-type" in self.response[0]:
            contenttype = self.response[0]["content-type"].split(";")[0]
        else:
            contenttype = None

        converter = Converters.marshaller_for(contenttype)
        return converter.unmarshal(self.body)
예제 #5
0
    def resource(self):

        if 'content-type' in self.response[0]:
            contenttype = self.response[0]['content-type'].split(';')[0]
        else:
            contenttype = None

        converter = Converters.marshaller_for(contenttype)
        return converter.unmarshal(self.body)
예제 #6
0
    def resource(self):
        """
        Returns the unmarshalled object of the response body
        """
        if 'content-type' in self.response[0]:
            contenttype = self.response[0]['content-type'].split(';')[0]
        else:
            contenttype = None

        converter = Converters.marshaller_for(contenttype)
        return converter.unmarshal(self.body)
예제 #7
0
    def resource(self):
        """
        Returns the unmarshalled object of the response body
        """
        if 'content-type' in self.response[0]:
            contenttype = self.response[0]['content-type'].split(';')[0]
        else:
            contenttype = None

        converter = Converters.marshaller_for(contenttype)
        return converter.unmarshal(self.body)