I followed this tutorial but I don't know how to get response data from server.
class Service(Resource):
def render_POST(self, request):
return 'response message'
I know that the response data will be displayed in the client
def dataReceived(self, bytes):
if self.remaining:
display = bytes[:self.remaining]
print 'Some data received:'
print display
self.remaining -= len(display)
How can I get the returned message from server and store it into a variable?
Just make
dataReceived
storedisplay
in an instance variable, and append to it every timedataReceived
is called. Then, onceconnectionLost
is called, you know you have the complete response.In the context of the full example: