コード例 #1
0
 def send_request(self, request):
     resp = requests.request(request.method,
                             request.url,
                             headers=request.headers,
                             data=request.body,
                             **self.options)
     return process_response(resp.status_code, resp.text)
コード例 #2
0
 def send_request(self, request):
     resp = requests.request(
         request.method,
         request.url,
         headers=request.headers,
         data=request.body,
         **self.options
     )
     return process_response(resp.status_code, resp.text)
コード例 #3
0
ファイル: sync.py プロジェクト: knowsis/pusher-rest-python
    def send_request(self, request):
        try:
            self.http.request(request.method, request.signed_path, request.body, {"Content-Type": "application/json"})
            resp = self.http.getresponse()
            body = resp.read().decode('utf8')
        except http_client.HTTPException as e:
            raise PusherError(repr(e))

        return process_response(resp.status, body)