Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions develop-docs/sdk/data-model/event-payloads/contexts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -795,23 +795,54 @@ Page context contains information about the page that the event occurred on.

Response context contains information about the HTTP response associated with the event.

The only and required field is `status_code`.

This is mostly set on transactions in a web server environment where one transaction represents a HTTP request/response cycle.

`cookies`

: _Optional_. The cookie values. Can be passed, unparsed, as a string, as a dictionary, or as a list of tuples.

- Example: `{ "PHPSESSID": "12345", "csrftoken": "1234567" }`

`headers`

: _Optional_. A dictionary of submitted headers. If a header appears multiple times it, needs to be merged according to the HTTP standard for header merging. Sentry treats header names as case-insensitive.

- Example: `{ "Content-Type": "text/plain" }`

`status_code`

: **Required.** The integer status code from the HTTP response associated with the event.

- Example: `200`

`body_size`

: _Optional_. HTTP response body size in bytes.

- Example: `1000`

`data`

: _Optional_. Response data in any format that makes sense. SDKs should discard large and binary bodies by default. Can be given as a string or structural data of any format.

- Example: `"Invalid request"`

**Example Response Context**

```json
{
"contexts": {
"response": {
"status_code": 404
"cookies": {
"PHPSESSID": "12345",
"csrftoken": "1234567"
},
"headers": {
"Content-Type": "text/plain"
},
"status_code": 500,
"body_size": 1000,
"data": "Invalid request"
}
}
}
Expand Down