BBjHttpRequest

Creation


BBjServletEvent

|

+-- BBjHttpRequest

Description

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

Creation

A BBjHttpRequest is created through the followingBBjServletEvent method:

Return Value

Method

BBjHttpRequest

getHttpRequest()

Methods of BBjHttpRequest

Return Value

Method

string

getCharacterEncoding()

int

getContentLength()

string

getContentType()

BBjVector

getCookies()

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

BBjVector

getFileUploads()

BBjFileUpload

getFileUpload(string name)

string

getBody()

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(BBjServletEvent p_event!)

      LET chan = UNT

      request! = p_event!.getHttpRequest()

      response! = p_event!.getHttpResponse()

      resp!.setContentType("text/html")

      open(chan)"JSERVLET"

      print(chan)"<html><body><h1>Hello BBj!</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.