GetHttpRequestHeader
PowerScript function
Description
Gets the HTTP request header. This function is only effective in the
installable cloud application deployed with PowerServer.
Applies to
Syntax
|
1 |
applicationname.GetHttpRequestHeader ( string headerName ) |
|
Argument |
Description |
|---|---|
|
applicationname |
The name of the application object in which you want to |
|
headerName |
A string whose value is the header name |
Return value
String.
Returns the information of the HTTP request header if it succeeds
and an empty string if the current application is not an installable cloud
app deployed with PowerServer.
Examples
The following code example gets the cookie in the HTTP request
header:
|
1 2 |
String ls_Header ls_Header = GetApplication().GetHttpRequestHeader("cookie") |
The following code example gets the cookie in the HTTP request
header, sends a request using this cookie and then gets the session
count.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
String ls_ServerURL, ls_SessionAPI, ls_Cookie, ls_Body Integer li_Return HttpClient lhc_client lhc_client = Create HttpClient ls_Cookie = GetApplication().GetHttpRequestHeader("cookie") ls_ServerURL = GetApplication().GetPowerServerURL() ls_SessionAPI = ls_ServerURL + "/api/session/getsessioncount" lhc_client.SetRequestHeader("cookie", ls_Cookie) li_Return = lhc_client.SendRequest("get", ls_SessionAPI) If li_Return = 1 Then lhc_client.GetResponseBody(ls_Body) End If |
See also