Skip to content

Commit a52e677

Browse files
committed
Adds example to review request body for troubleshooting.
1 parent 4cb2d53 commit a52e677

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

TROUBLESHOOTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
If you have a non-library SendGrid issue, please contact our [support team](https://support.sendgrid.com).
2+
3+
If you can't find a solution below, please open an [issue](https://github.com/sendgrid/sendgrid-python/issues).
4+
5+
## Table of Contents
6+
* [Viewing the Request Body](#request-body)
7+
8+
<a name="request-body"></a>
9+
## Viewing the Request Body
10+
11+
When debugging or testing, it may be useful to examine the raw request body to compare against the [documented format](https://sendgrid.com/docs/API_Reference/api_v3.html).
12+
13+
You can do this with something like:
14+
```javascript
15+
var requestPost = client.emptyRequest()
16+
17+
requestPost.method = 'POST'
18+
requestPost.path = '/v3/api_keys'
19+
requestPost.body = { data: 'some test data' }
20+
requestPost.headers['X-Test'] = 'test'
21+
22+
// Log request body before sending POST request.
23+
console.log(requestPost.body)
24+
25+
client.API(requestPost, (response) => { })
26+
```

0 commit comments

Comments
 (0)