Here are the examples of the python api zaqar.common.api.request.Request taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
3
Example 1
@staticmethod
def create_request(payload=None, env=None):
if payload is None:
payload = {}
action = payload.get('action')
body = payload.get('body', {})
headers = payload.get('headers')
return request.Request(action=action, body=body,
headers=headers, api="v2", env=env)
3
Example 2
def test_request(self):
action = consts.MESSAGE_POST
data = 'body'
env = {'foo': 'bar'}
req = request.Request(action=action, body=data, env=env)
self.assertEqual({'foo': 'bar'}, req._env)
self.assertEqual('body', req._body)
self.assertEqual(consts.MESSAGE_POST, req._action)