Class BodyBuilder


  • public class BodyBuilder
    extends java.lang.Object
    Allows building HTTP request body from session variables.
    • Method Detail

      • fromVar

        public BodyBuilder fromVar​(java.lang.String var)
        Use variable content as request body.
        Parameters:
        var - Variable name.
        Returns:
        Self.
      • pattern

        public BodyBuilder pattern​(java.lang.String pattern)
        Pattern replacing ${sessionvar} with variable contents in a string.
        Parameters:
        pattern - Pattern.
        Returns:
        Self.
      • text

        public BodyBuilder text​(java.lang.String text)
        String sent as-is.
        Parameters:
        text - String.
        Returns:
        Self.
      • form

        public FormGenerator.Builder form()
        Build form as if we were sending the request using HTML form. This option automatically adds Content-Type: application/x-www-form-urlencoded to the request headers.
        Returns:
        Builder.
      • fromFile

        public BodyBuilder fromFile​(java.lang.String path)
        Send contents of the file. Note that this method does NOT set content-type automatically.
        Parameters:
        path - Path to loaded file.
        Returns:
        Self.