예제 #1
0
 def test_payload(self, payload_filepath):
     headers = {
         "User-Agent": "SendGrid-Test",
         "Content-Type": "multipart/form-data; boundary=xYzZY"
     }
     client = Client(host=self.url, request_headers=headers)
     f = open(payload_filepath, 'r')
     data = f.read()
     return client.post(request_body=data)
예제 #2
0
    def test_payload(self, payload_filepath):
        """Send a test payload.

        Load a payload from payload_filepath, apply headers, and POST self.url.
        Return the response object.
        """
        headers = {
            "User-Agent": "SendGrid-Test",
            "Content-Type": "multipart/form-data; boundary=xYzZY"
        }
        client = Client(host=self.url, request_headers=headers)
        f = open(payload_filepath, 'r', encoding='utf-8')
        data = f.read()
        return client.post(request_body=data)
예제 #3
0
파일: send.py 프로젝트: KevinSJ/KindleEar
    def test_payload(self, payload_filepath):
        """Send a test payload.

        Load a payload from payload_filepath, apply headers, and POST self.url.
        Return the response object.
        """
        headers = {
            "User-Agent": "SendGrid-Test",
            "Content-Type": "multipart/form-data; boundary=xYzZY"
        }
        client = Client(host=self.url, request_headers=headers)
        f = open(payload_filepath, 'r', encoding='utf-8')
        data = f.read()
        return client.post(request_body=data)
예제 #4
0
파일: send.py 프로젝트: mtrencseni/webfeed
 def test_payload(self, payload_filepath):
     headers = {"User-Agent": "SendGrid-Test", "Content-Type": "multipart/form-data; boundary=xYzZY"}
     client = Client(host=self.url, request_headers=headers)
     f = open(payload_filepath, "r")
     data = f.read()
     return client.post(request_body=data)