Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7953f20

Browse filesBrowse files
Damodar DahalJon Wayne Parrott
authored andcommitted
Added headers manually to override error (GoogleCloudPlatform#791)
1 parent 30c4da0 commit 7953f20
Copy full SHA for 7953f20

File tree

Expand file treeCollapse file tree

1 file changed

+6
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-2
lines changed

‎appengine/standard/mailgun/main.py

Copy file name to clipboardExpand all lines: appengine/standard/mailgun/main.py
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def send_simple_message(recipient):
4646
'text': 'Test message from Mailgun'
4747
}
4848

49-
resp, content = http.request(url, 'POST', urlencode(data))
49+
resp, content = http.request(
50+
url, 'POST', urlencode(data),
51+
headers={"Content-Type": "application/x-www-form-urlencoded"})
5052

5153
if resp.status != 200:
5254
raise RuntimeError(
@@ -68,7 +70,9 @@ def send_complex_message(recipient):
6870
'html': '<html>HTML <strong>version</strong> of the body</html>'
6971
}
7072

71-
resp, content = http.request(url, 'POST', urlencode(data))
73+
resp, content = http.request(
74+
url, 'POST', urlencode(data),
75+
headers={"Content-Type": "application/x-www-form-urlencoded"})
7276

7377
if resp.status != 200:
7478
raise RuntimeError(

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.