{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":41076,"path":"platform-security/edge-encryption/c_requestAPI.md","title":"request","bundle":null,"doc_type":null,"release":"australia","body":"\n# request\n\nThe request object is a global object available in Edge Encryption rule action and condition scripts.\n\nThe request object is a JavaScript object that represents the client request coming in to the Edge Encryption proxy server. You must build your encryption rule to parse the request object, map request object values to fields in a table on the instance, and encrypt any sensitive data in the request object.\n\nThe request object includes the following attributes and data from the client request:\n\n|Field|Description|\n|-----|-----------|\n|path|The path portion of the URL.|\n|requestMethod|GET, POST, PUT, PATCH, DELETE.|\n|contentType|The Content-Type header field.|\n|urlParams|The parameters in the query string. This can also be evaluated to a String.|\n|postParams|If this is a form post, this contains the post parameters.|\n\n**Parent Topic:**[Encryption rule objects and APIs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-security/edge-encryption/api-overview.md)\n\n## request - getAsJsonContent\\(\\)\n\nReturns the request as an iterable object of type JsonNode.\n\nThis method is available only in an Edge Encryption rule if the request body is a valid JSON payload. If you are not sure what format the request body includes, check the contentType field on the request object.\n\nOnce the request is returned as a JsonNode object, you can use the [JSON APIs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-security/edge-encryption/json-overview.md) to iterate over the object and encrypt fields.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|JsonNode|The request as an iterable JsonNode.|\n\n## request - getAsXmlContent\\(\\)\n\nReturns the request content as an iterable object of type XMLContent.\n\nThis method is available only in an Edge Encryption rule if the request body is a valid XML payload. If you are not sure what format the request body includes, check the contentType field on the request object.\n\nOnce the request is returned as an XMLContent object, you can use the [XML APIs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-security/edge-encryption/xml-overview.md) to iterate over the object and encrypt fields.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|XMLContent|The request as an iterable object of type XMLContent.|\n\n## request - XMLContains\\(String path\\)\n\nReturns true if the given path exists in the XML DOM.\n\nThis method is available only if the request body is a valid XML payload. If you are not sure what format the request body includes, check the contentType field on the request object.\n\n|Name|Type|Description|\n|----|----|-----------|\n|path|String|XPath statement you are searching for.|\n\n|Type|Description|\n|----|-----------|\n|Boolean|Whether the given path exists in the XML DOM.|\n\n"}}