BBjHttpRequest (Deprecated)

BBjHttpRequest is deprecated for BBj 21.00 and higher, and has been replaced by BBxServletRequest.

Description

In BBj 12.00 and higher, BBjHttpRequest object provides methods for querying the state of an HTTP request.

Creation

BBjServletEvent > BBjHttpRequest

A BBjHttpRequest is created through the following BBjServletEvent method:

Return Value

Method

BBjHttpRequest

getHttpRequest()

Methods of BBjHttpRequest

Return Value

Method

Object getAttribute(string name)
BBjVector getAttributesNames()

string

getBody()

string

getCharacterEncoding()

int

getContentLength()

string

getContentType()

BBjVector

getCookies()

BBjFileUpload

getFileUpload(string name)

BBjVector

getFileUploads()

string

getHeader(string name)

BBjVector

getHeaderNames()

BBjVector

getHeaders(string name)

string

getLocalAddr()

Locale

getLocale()

BBjVector

getLocales()

string

getLocalName()

int

getLocalPort()

string

getMethod()

string

getParameter(string name)

BBjVector

getParameterNames()

BBjVector

getParameterValues(string name)

string

getPathInfo()

string

getProtocol()

string

getQueryString()

string

getRemoteAddr()

string

getRemoteHost()

int

getRemotePort()

string

getRemoteUser()

string

getRequestedSessionId()

string

getRequestURI()

string

getRequestURL()

string

getScheme()

string

getServerName()

int

getServerPort()

string

getServletPath()

BBjHttpSession

getSession()

boolean

isRequestedSessionIdFromCookie()

boolean

isRequestedSessionIdFromURL()

boolean

isRequestedSessionIdValid()

boolean

isSecure()

void removeAttribute(string name)
void setAttribute(string name, Object value)

Remarks

None.

Example

rem ' Obtain the instance of the BBjAPI object

let myAPI!=BBjAPI()
MyServlet! = new MyServlet()

data!.setCallback(data!.ON_WEB_CONNECTION,myServlet!, "myMethod")

process_events

class public MyServlet
    method public void myMethod(BBjServletEventp_event!)
        LETchan = UNT
        request!= p_event!.getHttpRequest()
        response!= p_event!.getHttpResponse()
        resp!.setContentType("text/html")
        open(chan)"JSERVLET"
        print(chan)"<html><body><h1>HelloBBj!</h1></body></html>"
        close(chan)
    methodend
classend

See Also

BBjAPI

BBjFileUpload

BBjHttpResponse

BBjServletEvent

BBjVector

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.