AMPscript
GetCookieValue
GetFormField
GetPostData
GetQueryStringParameter
GetRequestHeader
GetUserLanguages
Validate Your Server-Side JavaScript using WSProxy
You can use the Request object to retrieve various types of HTTP Request object properties and platform application values. The client browser passes this information to the server during an HTTP interaction, so this object contains information regarding the browser and session. These methods return a null value when no HTTP Request object exists or if the given value doesn’t exist in the header object.
Use these properties as part of your calls. Each property returns a specific value associated with the Request object. If no valid Request object exists, the property returns a null or false value as applicable.
Browser
Returns metadata related to the browser from the Request object as a JSON object:
PlatformBrowserVersionMajorVersionMinorVersionClientIP
HasSSL
IsSSL
Method
QueryString
ReferrerURL
RequestURL
UserAgent
This call redirects the browser from an HTTP to an HTTPS URL by using the IsSSL and HasSSL properties to determine if the page uses SSL and supports SSL, respectively.
1<script runat="server">
2 try {
3 if(!Platform.Request.IsSSL && Platform.Request.HasSSL) {
4 Platform.Response.Redirect('https' + Platform.Request.RequestURL.substring(4), true);
5 };
6 } catch (e) {
7 Write(Stringify(e));
8 };
9</script>