Object used to help with the request data.

Hierarchy

  • Request

Constructors

Methods

  • Same as calling optAttribute(name).orElse(null)

    Parameters

    • name: string

      Object name.

    Returns any

  • Load all the content into a byte array. If the request has large amounts of data, it will be better to use [[binaryStream()]]. This method will close the stream.

    Returns ByteArray

    Example

    const requestContent = B.net.request.binaryContent();
    
  • Provides a [[Java.IO.ServletInputStream]] to the callback functionto read the requests content. This method will close the stream.

    Parameters

    • inConsumer: ((input) => void)

      Function that uses input

    Returns void

    Example

    B.net.request.binaryStream(in => {
    let line = in.readLine();
    });
  • The name of the character encoding used in the body of this request. This property returns an empty string if the request does not specify a character encoding.

    Returns string

    Example

    const encoding = B.net.request.characterEncoding();
    

    Example

    const B.net.request.setCharacterEncoding('UTF-8');
    
  • Load all the content into a string. If the request has large amounts of data, it will be better to use [[stream]]. This method will close the stream.

    Returns string

    Example

    const requestContent = B.net.request.content();
    
  • Same as calling optCookie().orElse(null)

    Parameters

    • name: string

      Cookie value with name.

    Returns string

  • Get all the cookies as an object

    Returns {
        [key: string]: string;
    }

    • [key: string]: string

    Example

    const cookies = B.net.request.cookies();
    const cookieValue = cookies.dog
  • Get all the cookies as a Map

    Returns Map<string, string>

    Example

    const cookies = B.net.request.cookiesAsMap();
    const cookieValue = cookies.get('dog');
  • Returns the domain part of the request URI

    Returns string

  • Same as B.net.request.optParameter('foo').map(B.escapeHtml).orElse(null);

    Parameters

    • name: string

      Parameter value by name.

    Returns string

  • This will iterate over all parts of the multipart request, and give you the name and inputstream via callback function.

    Parameters

    • partConsumer: ((name, inputStream) => void)

      A function to handle each part.

        • (name, inputStream): void
        • Parameters

          Returns void

    Returns void

  • Similar to protocol() + domain() + path() + queryString()

    Returns string

  • Returns an object of all the headers this request contains. If the request has no headers, this method returns an empty object.

    Returns {
        [key: string]: string[];
    }

    • [key: string]: string[]
  • Retrieves an object from the request.

    Parameters

    • name: string

      Object name.

    Returns any

  • Same as calling optHeader().orElse(null)

    Parameters

    • name: string

    Returns string

  • Returns a list of all the header names this request contains. If the request has no headers, this method returns an empty list.

    Returns EList<string>

  • Returns all the values of the specified request header as an list of strings. Some headers, such as Accept-Language can be sent by clients as several headers each with a different value rather than sending the header as a comma separated list.

    If the request did not include any headers of the specified name, this method returns an empty list. The header name is case insensitive. You can use this method with any request header.

    Parameters

    • name: string

    Returns EList<string>

  • Indicates if the inbound request is coming from a mobile device. Same as calling optHeader("sec-ch-ua-mobile").filter(v => "?1" === v).isPresent()

    Returns boolean

  • Is this request a MultiPartMIME request

    Returns boolean

  • Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.

    Returns boolean

  • Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. Same as the value of the CGI variable REQUEST_METHOD

    Returns string

  • Retrieves an optional object from the request.

    Parameters

    • name: string

      Object name.

    Returns Optional<any>

  • Get an [[Java.Optional]] cookie by its name.

    Parameters

    • name: string

      Cookie value with name.

    Returns Optional<string>

    Example

    const cookieValue = B.net.request.optCookie('dog').orElse('mutt');
    
  • Gets an [[Java.Optional]] escaped parameter. Same as B.net.request.optParameter('foo').map(B.escapeHtml);

    Parameters

    • name: string

      Parameter value by name.

    Returns Optional<string>

  • Returns the optional string of the specified request header. If the request did not include a header of the specified name, this method returns an empty string. If there are multiple headers with the same name, this method returns the first head in the request. The header name is case insensitive. You can use this method with any request header.

    Parameters

    • name: string

    Returns Optional<string>

  • Get an [[Java.Optional]] parameters by its name.

    Parameters

    • name: string

      Parameter value by name.

    Returns Optional<string>

    Example

    const authorization = B.net.request.optParameter('Authorization');
    
  • Same as calling request.optParameter().orElse(null)

    Parameters

    • name: string

      Parameter value by name.

    Returns string

  • Get all the parameter names.

    Returns EList<string>

  • Get a parameter values by its name. If it doesn't exist an empty array will be returned.

    Parameters

    • name: string

      Parameter values by name.

    Returns EList<string>

    Example

    const authorization = B.net.request.optParameterValues('Authorization');
    
  • Get all the parameters as an object.

    Returns {
        [key: string]: string[];
    }

    • [key: string]: string[]
  • Get all the parameters as a map.

    Returns Map<string, string[]>

  • Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. The web container does not decode this String.

    Returns string

  • Indicates which OS the inbound request is coming from. Same as calling optHeader("sec-ch-ua-platform").

    Returns Optional<string>

  • Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.

    Returns string

  • Returns the query string that is contained in the request URL after the path. This method returns an empty string if the URL does not have a query string. Same as the value of the CGI variable QUERY_STRING

    Returns string

  • Returns the fully qualified name of the client or the last proxy that sent the request. If the engine cannot or chooses not to resolve the hostname (to improve performance), this method returns the dotted-string form of the IP address. For HTTP servlets, same as the value of the CGI variable REMOTE_HOST

    Returns string

  • Returns the Internet Protocol (IP) address of the client or last proxy that sent the request. For HTTP servlets, same as the value of the CGI variable REMOTE_ADDR

    Returns string

  • Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication. Same as the value of the CGI variable REMOTE_USER.

    Returns string

  • Removes an object from the request.

    Parameters

    • name: string

      Object name.

    Returns void

  • Set an object into the request that can be retrieved with getAttribute later.

    Parameters

    • name: string

      Object's name.

    • object: any

      Object to be stored in the request

    Returns void

  • Provides a [[Java.IO.BufferedReader]] to the callback function to read the requests content. This method will close the stream.

    Parameters

    • inConsumer: ((reader) => void)

      Function that uses input

    Returns void

    Example

    B.net.request.stream(in => {
    });
  • The path() + queryString()

    Returns string

Generated using TypeDoc