Esempio n. 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)
Esempio n. 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)
Esempio n. 3
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)
Esempio n. 4
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)