You're looking for Platform.Request.Method()
, that's listed in the HTTP Properties Functions article.
Here's an example snippet that will extract most of the data you might need:
<script runat="server">
Platform.Load("core", "1");
var requestData = {
Method: Platform.Request.Method(),
Browser: Platform.Request.Browser(),
UserAgent: Platform.Request.UserAgent(),
ClientIP: Platform.Request.ClientIP(),
HasSSL: Platform.Request.HasSSL(),
IsSSL: Platform.Request.IsSSL(),
QueryString: Platform.Request.QueryString(),
ReferrerURL: Platform.Request.ReferrerURL(),
RequestURL: Platform.Request.RequestURL(),
UserAgent: Platform.Request.UserAgent(),
Authorization: Platform.Request.GetRequestHeader('Authorization'),
PostData: Platform.Request.GetPostData('utf-8')
}
Write(Stringify(requestData))
</script>
For example a request from Postman will get something like this in response:
{
"Method": "PATCH",
"Browser": {
"Platform": "Unknown",
"Browser": "Unknown",
"Version": "0.0",
"MajorVersion": 0,
"MinorVersion": 0
},
"UserAgent": "PostmanRuntime/7.31.3",
"ClientIP": "127.0.0.1",
"HasSSL": true,
"IsSSL": true,
"QueryString": "",
"ReferrerURL": null,
"RequestURL": "https://subdomain.yourdomain.com/your-page",
"Authorization": "Basic SGVsbG86U0ZTdGFja0V4Y2hhbmdl",
"PostData": "{\r\n \"hello\": \"world\"\r\n}"
}