diff --git a/develop-docs/sdk/data-model/event-payloads/contexts.mdx b/develop-docs/sdk/data-model/event-payloads/contexts.mdx index 9447817dd2860..df11d325ec0a7 100644 --- a/develop-docs/sdk/data-model/event-payloads/contexts.mdx +++ b/develop-docs/sdk/data-model/event-payloads/contexts.mdx @@ -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" } } }