 | | | S/Web Objects 

Request This object handles information relating to the HTTP request. This is perhaps the most important object existing in S/Web. This handles all information related to the actual request. Properties: | Property | Get/Set | Description |
|---|
| ACCEPT | Get | The Accept request-header field can be used to specify certain media types which are acceptable for the response. Accept headers can be used to indicate that the request is specifically limited to a small set of desired types, as in the case of a request for an in-line image. | | AUTHTYPE | Get | The type of authentication expected. Will normally be null or "BASIC". If Basic S/Web will invoke Basic Authentication rather than standard S/Web security. | | BROWSER | Get/Set | This property identifies the browser and version reported by the browser. Note: This might not be the actual browser. See WWW_REQUEST_EQUATES for browser types. | | CONTENTEXT | Get | This property returns the file extension of request content files. This is normally ".ipc". | | CONTENTLENGTH | Get | The Content-Length entity-header field indicates the size of the entity-body, in decimal number of OCTETs, sent to the recipient or, in the case of the HEAD method, the size of the entity-body that would have been sent had the request been a GET. | | CONTENTTYPE | Get | The Content-Type entity-header field indicates the media type of the entity-body sent to the recipient or, in the case of the HEAD method, the media type that would have been sent had the request been a GET. | | COOKIES | Get | This property returns the entire cookie string as passed back from the browser to the client. If EncryptCookies is set, the cookies are decrypted before returning the value. | | ENCRYPTCOOKIES | Get/Set | This property tells S/Web whether to encrypt cookies before passing them back to the browser. | | FROM | Get | The From request-header field, if given, SHOULD contain an Internet e-mail address for the human user who controls the requesting user agent. | | GATEWAY | Get | Not used - always returns blank as this is an ISAPI implementation not a CGI implementation. | | HEADER | Get | This property returns the entire HTTP header. | | HEADEREXT | Get | This subroutine returns the file extension of request header files (which is normally ".iph". | | HIDEUICONTENT | Get/Set | If TRUE$ then no CONTENT details are displayed in the UI. (Useful for security purposes) | | HTTPS | Get | This value returns TRUE$ if the request is sent by HTTPS | | PATHINFO | Get | Contains the name of the routine the client is executing. | | PATHTRANSLATED | Get | Contains where the requested directory really exists on the server, as opposed to the share name. | | PROCNAME | Get/Set | This property holds the name of the S/Web procedure to execute. | QUERYARGS QUERYKEYS | Get | A dynamic array of Query Keys extracted from the request content | | QUERYCHECK | Get/Set | If TRUE$ then normal query key/value checking and parsing will take place. If FALSE$ then no checking takes place which also means that the GETQUERYARG and GETQUERYVAL methods will NOT return a value! To extract values you MUST use the GETCONTENT method and process the raw content yourself! This is useful if sending XML strings. | | REFERER | Get | The Referer[sic] request-header field allows the client to specify, for the server's benefit, the address (URI) of the resource from which the Request-URI was obtained (the "referrer", although the header field is misspelled.) The Referer request-header allows a server to generate lists of back-links to resources for interest, logging, optimized caching, etc. It also allows obsolete or mistyped links to be traced for maintenance. The Referer field MUST NOT be sent if the Request-URI was obtained from a source that does not have its own URI, such as input from the user keyboard. | | REMOTEADDR | Get | The IP address of the agent sending the request to the server. This is not necessarily that of the client. | | REMOTEHOST | Get | The fully qualified domain name of the agent sending the request to the server, if available, otherwise NULL. Not necessarily that of the client | | REMOTEIDENT | Get | If the HTTP server supports RFC 931 identification, then this variable will be set to the remote user name retrieved from the server. Usage of this variable should be limited to logging only | | REMOTEUSER | Get | If the server supports user authentication, and the script is protected, this is the username they have authenticated as | | REMOTEPW | Get | If the server supports user authentication, and the script is protected, this is the username they have authenticated as | | REQUESTDIR | Get | the location that S/Web drops request files into. | | REQUESTMETHOD | Get | The method with which the request was made. For HTTP, this is "GET", "HEAD", "POST", etc | | SCRIPTNAME | Get | A virtual path to the script being executed, used for self-referencing URLs. | | SERVEREXTENSION | Get | Defines the type of SWEB (ISAPI, Perl, etc.) you are using | | SERVERNAME | Get | The name of the current server, or its IP address | | SERVERPORT | Get | This is the port number the request was received from. This is normally 80 for HTTP and 443 for SSL (HTTPS) | | SERVERPROTOCOL | Get | The version of HTTP used for the request. This is normally 1.0 or 1.1. | | SERVERSOFTWARE | Get | Identifies the server software. This function is not supported by all web servers and may be blank on your system. | | SERVERURL | Get | The path of the procedure executing, usually /scripts/sweb.dll | | USERAGENT | Get | The User-Agent request-header field contains information about the user agent originating the request. This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring responses to avoid particular user agent limitations. User agents SHOULD include this field with requests. The field can contain multiple product tokens (section 3.8) and comments identifying the agent and any sub-products which form a significant part of the user agent. By convention, the product tokens are listed in order of their significance for identifying the application. | | XVERSION | Get | the version of S/Web |
Methods: call www_Exec_Method( "REQUEST", method, param1, param2, param3, param4, param5, errorText) | Method | Description |
|---|
| ARCHIVE | This method saves the request header, it's content and any associated client data to the WWW_REQUEST and WWW_CONTENT tables | | CREATE | This function creates a new request object from the header file name passed in object. | | DESTROY | This function destroys the existing request object. | | GET | This method retrieves properties of the request object | | GETCONTENT | This method returns the raw HTTP request query string as sent from the client. | | GETCOOKIE | This subroutine attempts to extract a named cookie from the HTTP Request object. | GETQUERYARG GETQUERYKEY | This method looks in the query string to see if a given instance of an ARGUMENT is present, regardless of whether or not it has been assigned a value. | GETQUERYVAL QUERYPARAM | This method returns a query value to the caller based on the key of the data passed. | | SET | This method sets properties of the response object | | SETCONTENT | This method allows for the wholesale replacement of the current request's content. |
[top] 
This method saves the request header, it's content and any associated client data to the WWW_REQUEST and WWW_CONTENT tables. (NB this method only works if the SESSION objects TRACKREQUESTS property is set ) | Argument | Description |
|---|
| param1 | Not used. | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical ......
Properties = "NAME" Properties := @RM : "DATA" if www_Exec_Method( "REQUEST", "GET", Properties, RetVals, "", "", "", "", errorText ) then UserName = Field( RetVals, @RM, 1 ) UserData = Field( RetVals, @RM, 2 ) end else abort = TRUE$ end If Abort Else * Archive all guest users who are searching the tech support archives * We can use this to see why people come to visit and what makes them want to register to the site. If ( UserName = "GUEST" ) And ( UserData = "TECHSUPT" ) Then if www_Exec_Method( "REQUEST", "ARCHIVE", "", "", "", "", "", "", errorText ) then null end else abort = TRUE$ end End End [top] 
This function creates a new request object from the header file name passed in object. This function is never called by the end user and is just documented for completion | Argument | Description |
|---|
| param1 | Not used. | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
[top] 
This function destroys the existing request object. Use of this function is optional, as the system will perform the necessary actions before creating a new object. | Argument | Description |
|---|
| param1 | Not used. | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
Example declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical if www_Exec_Method( "RESPONSE", "SEND", "", "", "", "", "", "", errorText ) then * The request is now back on it's way to the client. * We can continue processing information, if we wish, however, * there is no direct way to return it to the client. * Continue processing... end else abort = TRUE$ end ........... ........... * After sending back the request, we might want to destroy the current request... if www_Exec_Method( "REQUEST", "DESTROY", "", "", "", "", "", "", errorText ) then null end else abort = TRUE$ end [top] 
This method retrieves properties of the request object | Argument | Description |
|---|
| param1 | Property to retrieve. Can be @Rm delimited to retrieve multiple properties. | | param2 | Returned properties. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
Properties = "BROWSER" Values = ""
if www_Exec_Method( "REQUEST", "GET", Properties, Values, "", "", "", errorText ) then * continue on end else abort = TRUE$ end [top] 
This method returns the raw HTTP request query string as sent from the client | Argument | Description |
|---|
| param1 | Buffer number to retrieve (defaults to 1) | | param2 | Returned data | | param3 | Number of next buffer - zero if no more | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
if www_Exec_Method( "REQUEST", "GETCONTENT", 1, QueryString, NextBuffer, "", "", errorText ) then * continue end else abort = TRUE$ end [top] 
This subroutine attempts to extract a named cookie from the HTTP Request object. | Argument | Description |
|---|
| param1 | Name of the cookie to retrieve | | param2 | Cookie information returned | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
CookieName = "LASTVISIT" Value = ""
if www_Exec_Method( "REQUEST", "GETCOOKIE", CookieName, Value, "", "", "", errorText ) then * continue end else abort = TRUE$ end [top] 
This method looks in the query string to see if a given instance of an ARGUMENT is present, regardless of whether or not it has been assigned a value. Note that this method is used to see if an argument exists and the fact that it returns the first frame is a bonus. Use GETQUERYVALUE to retrieve the data. | Argument | Description |
|---|
| param1 | Name of the argument to retrieve | | param2 | Instance number of the query to retrieve (used if there are more than one argument with the same name) - defaults to 1. | | param3 | Value exists flag - Boolean | | param4 | The first frame of the argument | | param5 | Boolean flag indicating there is more than on frame of data in the argument. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
ArgumentName = "ADVISOR_NAME" Instance = 1 ValueThere = 1
if www_Exec_Method( "REQUEST", "GETQUERYARG", ArgumentName, INstance, ValueThere, "", "", errorText ) then * If ValueThere is true then we know we're in the HTML page dealing with advisors so react accordingly * so we know the user is submitting information not requesting a page end else abort = TRUE$ end [top] 
This method returns a query value to the caller based on the key of the data passed. | Argument | Description |
|---|
| param1 | Name of the argument to retrieve. | | param2 | Instance number of the argument to retrieve (defaults to 1) | | param3 | Chunk to get (defaults to 1 - used if data is > 64K) | | param4 | Query value or param3th 64K chunk | | param5 | Next query value buffer number (0 if no more) |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
ArgumentName = "ADVISOR_NAME" Instance = 1 Chunk = 1 Value = 1 NextChunk = 1
if www_Exec_Method( "REQUEST", "GETQUERYVAL", ArgumentName, Instance, Chunk, Value, NextChunk, errorText ) then * Process data end else abort = TRUE$ end [top] 
This method sets properties of the request object | Argument | Description |
|---|
| param1 | Properties to set delimited by @Rm. | | param2 | Values to use delimited by @Rm | | param3 | Returns previous values delimited by @Rm. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
If UserName = "ADMIN" Then * Normal users get a query only window here - admin gets TCL so call different program Properties = "PROCNAME" Procedure = "SWEB_TCL" if www_Exec_Method( "REQUEST", "SET", Properties, Procedure, "", "", "", errorText ) then * continue on end else abort = TRUE$ end End [top] 
This method allows for the wholesale replacement of the current request's content. Where this could be useful is if the developer wanted to redirect a client to another S/Web routine requiring different parameters in the query. | Argument | Description |
|---|
| param1 | Any valid query string that will subsequently become the new request content. Remember that if the request contains non alpha numeric characters it must be ESCAPEd using WWW_Utility first. | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical
If UserName = "ADMIN" Then * Redirect the user to another routine Properties = "PROCNAME" Procedure = "SWEB_TCL" if www_Exec_Method( "REQUEST", "SET", Properties, Procedure, "", "", "", errorText ) then * continue on and write out a new request NewRequest = "USERNAME=ADMIN&SECLEVEL=1&SERVER=SERVERID" NewRequest = WWW_Utility("ESCAPE", NewRequest) if www_Exec_Method( "REQUEST", "SETCONTENT", NewRequest, Procedure, "", "", "", errorText ) then * continue on End end else abort = TRUE$ end End [top] 
|  |  |  |