HttpForm (class)
public HttpForm {inherits Dialog}
Import from: CURL.GUI.STANDARD. Defined in package CURL.GUI.CONTROL-BASE.

Creates a specialized Dialog that can interact with CGI programs on a Web server.

Description

HttpForm is a section of a document containing normal content, links, controls and labels. Users "complete" a form by modifying its controls, before submitting the form to an agent for processing (e.g., to a Web server, to a mail server, etc.)

The function of HttpForm is similar to the <FORM> tag in HTML.

HttpForm can be nested, but only the controls directly inside a given HttpForm are submitted in any given request.

To include hidden controls in a form, use any ordinary control (such as TextField) and set the width and height to 0pt, or set the Graphic.visible? property to false. (Note that an invisible control still occupies space on the screen if the width or height is nonzero.)

Constructors
default:Creates an HttpForm object.
constructor public {HttpForm.default
    form-action:Url,
    method:HttpRequestMethod = HttpRequestMethod.get,
    encoding:String = HttpFormData.urlencoded-mime-type,
    target:String = "_self",
    default-character-encoding:CharEncoding = CharEncoding.ascii,
    ...
}
Properties
default-character-encoding:The default character encoding to use for the String parameters. It also specifies the character encoding used to convert the MIME related header and separator strings into bytes.
field public HttpForm.default-character-encoding:CharEncoding
encoding:The encoding type for the request sent to the server.
field public HttpForm.encoding:String
form-action:The URL for the HTTP request.
field public HttpForm.form-action:Url
method:The HttpRequestMethod to use.
accessor public final HttpForm.method:HttpRequestMethod
setter public final HttpForm.method:HttpRequestMethod
style-element:The "element" or "type" of this Visual, for the purpose of styling.
accessor public HttpForm.style-element:String
target:Specifies the browser window in which the result of the HttpForm.form-action will be displayed.
field public HttpForm.target:String ="_self"
Properties inherited from Dialog: _controls, controls, look-and-feel, open?, options-present-here, return-state, use-look-and-feel?
Properties inherited from StandardActiveTraversalContainer: _current-active, current-active, repeat-traversal?, traversors
Properties inherited from CommandBinding: bound-command, bound-command-impl
Properties inherited from StandardActiveTraversor: focus-object
Properties inherited from Frame: clonable-class?, halign, halign-spec, hstretch?, hstretch?-spec, valign, valign-spec, vstretch?, vstretch?-spec
Properties inherited from ActiveTraversor: _active-traversal-container, active-traversal-container, mnemonic, tab-index, takes-focus?, valid?, validation-result
Properties inherited from BaseFrame: child, completely-clonable-children?, graphical-children, ordered-children, reverse-ordered-children, width-first?
Properties inherited from DataBindingTarget: data-binding-context, data-bindings
Properties inherited from EventTarget: event-handlers
Properties inherited from Visual: _style-element, cursor, data-source, dragee, font-size, input-method-enabled?, input-method-keyboard-mode, name, options, style-class, style-manager, style-options, test-description, test-name, test-parent?, test-type-name, test-visible?, tooltip, user-data
Properties inherited from OptionListInterface: option-register-proc, registered-option-keys
Properties inherited from GetBoundsBox: layout-locally-valid?, layout-valid?
Properties inherited from Box: clip-child-shadows?
Properties inherited from Graphic: avoid-page-break?, background, border-color, border-spec, border-style, border-width, cell-border-spec, cell-border-width, cell-margin, discrete-select-in-range?, display-context, enabled?, graphic-selectable, height, horigin, is-paginating?, layout, margin, opaque-to-events?, option-parent, outside-margin, pagination-state, parent, selection-context, shadow-color, shadow-spec, visible?, vorigin, width
Methods
add-file:Adds a file to be submitted with this HttpForm.
public {HttpForm.add-file
    name:String,
    url:Url,
    content-type:#String = "application/octet-stream"
}:void
add-file-data:Adds arbitrary data to be submitted with this HttpForm.
public {HttpForm.add-file-data
    name:String,
    data:{Array-of byte},
    content-type:#String = "application/octet-stream",
    filename:String = "",
    content-transfer-encoding:#String = "binary"
}:void
add-string-param:Adds a name and value pair to be submitted with this HttpForm.
public {HttpForm.add-string-param name:String, value:String}:void
async-submit-open:Asynchronously submits an HttpForm for text input, and calls the provided event handlers with an AsyncFileOpenEvent that contains either an exception or the HttpTextInputStream that was opened.
public {HttpForm.async-submit-open
    submit-name:#String = null,
    submit-value:#String = null,
    character-encoding:CharEncoding = CharEncoding.none-specified,
    buffer-size:int = {calculate-instances-per-memory-size default-buffer-memory-size, char },
    unread-size:int = {min 4, buffer-size div 4},
    request-headers:#HttpRequestHeaders = null,
    auto-redirect?:bool = true,
    always-return-response-headers?:bool = false,
    event-handler:EventHandler,
    ...:EventHandler
}:AsyncFileOpener
async-submit-open-byte:Asynchronously submits an HttpForm for byte input, and calls the provided event handlers with an AsyncFileOpenEvent that contains either an exception or the HttpByteInputStream that was opened.
public {HttpForm.async-submit-open-byte
    submit-name:#String = null,
    submit-value:#String = null,
    buffer-size:int = {calculate-instances-per-memory-size default-buffer-memory-size, byte },
    unread-size:int = {min 4, buffer-size div 4},
    request-headers:#HttpRequestHeaders = null,
    auto-redirect?:bool = true,
    always-return-response-headers?:bool = false,
    event-handler:EventHandler,
    ...:EventHandler
}:AsyncFileOpener
non-keyword-init-arg:Invoked when InitRestArgParser.process-rest-args encounters a non-keyword argument.
public {HttpForm.non-keyword-init-arg a:any}:void
register-control:Register a Control with this ControlContainer.
public {HttpForm.register-control c:Control}:void
reset:Resets the controls in the form to their initial values. It also removes all the data that was added to this form using the methods HttpForm.add-file, HttpForm.add-file-data or HttpForm.add-string-param. This method then calls Dialog.reset.

Any HttpFormParams that where added during the construction of this HttpForm will not be removed.
public {HttpForm.reset}:void
reset-all:Resets the controls in the form to their initial values. It also removes all the data that was added to this form using the methods HttpForm.add-file, HttpForm.add-file-data or HttpForm.add-string-param including the HttpFormParams that where added when constructing this HttpForm. This method then calls Dialog.reset.
public {HttpForm.reset-all}:void
submit:Submits the form and browses to HttpForm.form-action.
public {HttpForm.submit
    submit-name:#String = null,
    submit-value:#String = null
}:void
submit-open:Submits the HttpForm and obtains the response as a text stream.
public {HttpForm.submit-open
    submit-name:#String = null,
    submit-value:#String = null,
    character-encoding:CharEncoding = CharEncoding.none-specified,
    buffer-size:int = {calculate-instances-per-memory-size default-buffer-memory-size, char },
    unread-size:int = {min 4, buffer-size div 4},
    request-headers:#HttpRequestHeaders = null,
    auto-redirect?:bool = true,
    always-return-response-headers?:bool = false
}:HttpTextInputStream
submit-open-byte:Submits the form and obtains the response as a byte stream.
public {HttpForm.submit-open-byte
    submit-name:#String = null,
    submit-value:#String = null,
    buffer-size:int = {calculate-instances-per-memory-size default-buffer-memory-size, byte },
    unread-size:int = {min 4, buffer-size div 4},
    request-headers:#HttpRequestHeaders = null,
    auto-redirect?:bool = true,
    always-return-response-headers?:bool = false
}:HttpByteInputStream
unregister-control:Unregister a Control from this ControlContainer.
public {HttpForm.unregister-control c:Control}:void
Methods inherited from Dialog: close, get-by-name, handle-look-and-feel-change, handle-observer-message, option-lookup-here, option-propagate-notify, show, show-at-xy
Methods inherited from StandardActiveTraversalContainer: add-internal, become-active, become-active-from-traversal, dispatch-mnemonic, get-sorted-traversors, internal-remove-child, on-key-press, react-to-child-change, register-active-traversor, traverse, traverse-from-visual, unregister-active-traversor
Methods inherited from ControlContainer: commit
Methods inherited from ActiveTraversalContainer: insist-active
Methods inherited from StandardActiveTraversor: fire-event-at-container, handle-mnemonic, on-focus-in
Methods inherited from Frame: add, clone-appearance-helper, remove-child
Methods inherited from GraphicOptions: any-to-Distance, get-display-context
Methods inherited from GuiEventTarget: handle-event, on-action, on-cancel-mode, on-command-changed, on-commit, on-composition-change-event, on-composition-result-event, on-context-menu-event, on-current-record-change-request, on-current-record-changed, on-destroy-notify, on-destroy-requested, on-drag-over, on-drag-pointer, on-drag-started, on-drop, on-end-composition-event, on-focus-event, on-focus-out, on-grab-release, on-gui-event, on-input-method-event, on-key-event, on-pointer-button, on-pointer-crossing, on-pointer-event, on-pointer-motion, on-pointer-press, on-pointer-release, on-pointer-scroll, on-raw-key-event, on-raw-key-press, on-raw-key-release, on-reset, on-selectable-added, on-selectable-removed, on-selection-changed, on-selection-context-activated, on-selection-context-deactivated, on-selection-event, on-start-composition-event, on-start-event, on-stop-event, on-view-activate, on-view-deactivate, on-window-close, remove-event-handlers-for-event-class
Methods inherited from Observer: observe, stop-observing
Methods inherited from ActiveTraversor: mark-invalid, mark-valid, request-key-focus
Methods inherited from BaseFrame: after-reposition, allocate-layout-object, attempt-revalidate-layout, before-reposition, compute-child-bounds, compute-parent-elastic, constrain-height, constrain-width, draw, end-pagination, get-height-preference, get-text, get-width-preference, install-child-bounds, note-attached, note-detaching, notify-option-children, paginate, pick-child, propagate-request-layout, register-options, set-size
Methods inherited from DataBindingTarget: add-data-binding, get-data-binding, refresh-data-binding, remove-data-binding, unset-property, update-data-binding, validate-data-binding
Methods inherited from EventTarget: accepts-event-class?, add-event-handler, event-handler-present?, remove-event-handler, verify-event
Methods inherited from Visual: add-from-init-args, add-option, add-style-option, animate, change-cursor, clonable-appearance?, clone-appearance, get-focus-manager, get-layout-context, get-test-parent, get-test-property, get-view, maybe-fire-attach-event, maybe-fire-detach-event, note-caret-position, on-drag-leave, on-pointer-leave, pop-cursor, prepare-test-object, prepare-test-parent, push-cursor, quantize-width, release-key-focus, remove-option, remove-style-option, scroll-to-include, test-record, test-run, transform-from-display-coordinates, transform-from-graphical-root-coordinates, transform-to-display-coordinates, transform-to-graphical-root-coordinates
Methods inherited from BasicBox: contains-point?, find-graphic-at, handle-crossing, on-pointer-envelope-event, pointer-enter-occurred, pointer-leave-occurred
Methods inherited from OptionListInterface: change-option-parent-notify, clone-options, get-option, get-option-by-name, keyword-init-arg, local-add-notify, local-remove-notify, name-to-option-key, new-option-item, option-change-notify, option-lookup, option-set?, propagate-option-change, remove-styles, set-option-by-name, set-style-option-by-name, unset-option-by-name, unset-style-option-by-name
Methods inherited from BasicEventTarget: enqueue-event
Methods inherited from GetBoundsBox: get-bounds, get-elastic-bounds-into, get-nonparent-bounds-into, request-layout, validate-layout
Methods inherited from InitRestArgParser: process-rest-args
Methods inherited from Box: clear, compare-children, find-test-children, get-delimited-child-text-selection, get-range-as-selected-text, get-visible-rect-in-root-into, graphical-child-visible-at, make-gui-mark, search-next-here, search-prev-here
Methods inherited from Graphic: create-pagination-state, detach, draw-range-as-selected, draw-shadow, find-ancestor, find-graphical-ancestor, fire-inferior-crossing-event, get-graphical-root, get-origin-in-graphical-ancestor, get-origin-in-root, get-pagination-state, get-top-left-in-ancestor, get-visible-bounds-into, on-drag-enter, on-inspection, on-pointer-enter, option-changed, paint-with-decorations, replace-with, request-draw, request-draw-rect, request-pointer-trace, search-next, search-prev, set-layout, start-pagination, xy-offset-to
Methods inherited from Object: object-describe, object-describe-for-debugging, object-serialize

Constructor Details
default (constructor)
public {HttpForm.default
    form-action:Url,
    method:HttpRequestMethod = HttpRequestMethod.get,
    encoding:String = HttpFormData.urlencoded-mime-type,
    target:String = "_self",
    default-character-encoding:CharEncoding = CharEncoding.ascii,
    ...
}

Creates an HttpForm object.

form-action: The URL for the HTTP request. This is a positional argument.
method: The HttpRequestMethod to use. Valid values are HttpRequestMethod.get and HttpRequestMethod.post.
encoding: The encoding type for the request sent to the server.

Use it to describe the format to use to send the form data to the server. It is either HttpFormData.urlencoded-mime-type or HttpFormData.multipart-mime-type.

HttpFormData.urlencoded-mime-type supports both the GET and the POST methods.

HttpFormData.multipart-mime-type supports only the POST method.

Calling HttpForm.add-file or HttpForm.add-file-data to add data to a HttpForm means that the form must be submitted in multipart format. In this case, the only valid encoding is HttpFormData.multipart-mime-type.
target: The browser window in which the form-action will be displayed. For more information, see HttpForm.target.
default-character-encoding: The default character encoding to use for the String parameters. This parameter also specifies the character encoding used to convert the MIME related header and separator strings into bytes.

Normally, you should use CharEncoding.ascii or a superset of it, unless you need to use an encoding that does not have CharEncoding.ascii as a subset for HttpFormData.urlencoded-mime-type form data.
...: Rest arguments are passed to the Dialog constructor.

You may pass HttpFormParams. These parameters are added to the HttpForm and will be submitted when the HttpForm is submitted. Calling HttpForm.reset will not remove these parameters. You will need to call HttpForm.reset-all method in order to remove them.

Description

An HttpForm will submit the values of each control it contains if the following conditions are met:

See the documentation of the form-value getter for a control to see what it will return if its form is submitted. For example, see ListBox.form-value.


Property Details
default-character-encoding (field)
public HttpForm.default-character-encoding:CharEncoding

The default character encoding to use for the String parameters. It also specifies the character encoding used to convert the MIME related header and separator strings into bytes.

Description

Normally, you should use CharEncoding.ascii or a superset of it, unless you need to use an encoding that does not have CharEncoding.ascii as a subset for HttpFormData.urlencoded-mime-type form data.


encoding (field)
public HttpForm.encoding:String

The encoding type for the request sent to the server.

Description

Use encoding to describe the format to use to send the form data to the server. It is either HttpFormData.urlencoded-mime-type or HttpFormData.multipart-mime-type.

Notes

HttpFormData.urlencoded-mime-type supports both the GET and the POST methods.

HttpFormData.multipart-mime-type supports only the POST method.

Calling HttpForm.add-file or HttpForm.add-file-data to add data to a HttpForm means that the form must be submitted in multipart format. In this case, the only valid encoding is HttpFormData.multipart-mime-type.


form-action (field)
public HttpForm.form-action:Url

The URL for the HTTP request.



method (accessor)
accessor public final HttpForm.method:HttpRequestMethod
setter public final HttpForm.method:HttpRequestMethod

The HttpRequestMethod to use.

Description

Valid values are:


style-element (accessor)
accessor public HttpForm.style-element:String

The "element" or "type" of this Visual, for the purpose of styling.

Description

This implementation returns the value of Visual._style-element but is normally overridden to return a constant value.

Overriding

If a subclass of Visual should be stylable separately from other types of objects, this getter should be overridden to return an appropriate string. By convention, this string is the name of the class or the name of the markup that produces the object.

An override must return self._style-element if it is not the empty string.
Introduced in: version 6.0


target (field)
public HttpForm.target:String ="_self"

Specifies the browser window in which the result of the HttpForm.form-action will be displayed.

Description

Values for target are shown in the table below.


For more information on targets, see Applet.browse-url.


Method Details
add-file (method)
public {HttpForm.add-file
    name:String,
    url:Url,
    content-type:#String = "application/octet-stream"
}:void

Adds a file to be submitted with this HttpForm.

name: The parameter name (for use by the server).
url: The path to the file to be added. Any valid Url is allowed as long as the contents of the file can be read by the applet.

The filename part of this URL is added to the MIME header as the filename.

The URL must contain only ASCII characters or be encoded according to RFC 2045.

If you want the user to select a file to be attached, use choose-file or choose-location.
content-type: Ideally the client would determine the type of content and supply a suitable MIME type string. If this is not possible, use "application/octet-stream" and the server or ultimate recipient can try to deduce the MIME type from the file name and/or from the data in the file.

Description

The specified file is added to the data to be submitted as a new file parameter. Call this method multiple times to add more than one file. All file parameters with the same parameter name will be sent to the server together.

Notes

See also HttpForm.reset.


add-file-data (method)
public {HttpForm.add-file-data
    name:String,
    data:{Array-of byte},
    content-type:#String = "application/octet-stream",
    filename:String = "",
    content-transfer-encoding:#String = "binary"
}:void

Adds arbitrary data to be submitted with this HttpForm.

name: The parameter name for use by the server.
data: The data to be added to the form.
content-type: Ideally the client would determine the type of content and supply a suitable MIME type string. If this is not possible, use "application/octet-stream" and the server or ultimate recipient can try to deduce the MIME type from the file name and/or from the data in the file.
filename: If it is not null, a filename header will be included and will specify this name.

This string must contain only ASCII characters. If there is a possibility that it may not, it should be encoded according to RFC 2045.
content-transfer-encoding: This is the Content-Transfer-Encoding header value to be used for the file being added. null means no content-transfer-encoding header. If the applet has encoded the data being sent, this argument would be used to describe the encoding.

Description

The data provided is added to the data to be submitted as a new "part". Call this method multiple times to add more than one data part.

Notes

See also HttpForm.reset.


add-string-param (method)
public {HttpForm.add-string-param name:String, value:String}:void

Adds a name and value pair to be submitted with this HttpForm.

name: The parameter name for use by the server.
value: The value to be added to the form corresponding to name.

Description

The specified name and value pair is added to the data to be submitted as a new parameter. Call this method multiple times to add more than one name and value pairs.

Notes

See also HttpForm.reset.


async-submit-open (method)
public {HttpForm.async-submit-open
    submit-name:#String = null,
    submit-value:#String = null,
    character-encoding:CharEncoding = CharEncoding.none-specified,
    buffer-size:int = {calculate-instances-per-memory-size default-buffer-memory-size, char },
    unread-size:int = {min 4, buffer-size div 4},
    request-headers:#HttpRequestHeaders = null,
    auto-redirect?:bool = true,
    always-return-response-headers?:bool = false,
    event-handler:EventHandler,
    ...:EventHandler
}:AsyncFileOpener

Asynchronously submits an HttpForm for text input, and calls the provided event handlers with an AsyncFileOpenEvent that contains either an exception or the HttpTextInputStream that was opened.

submit-name, submit-value: If submit-name and submit-value are non-null, the name/value pair is submitted with the form. Both the name and the value are URL encoded before being submitted.
character-encoding: Indicates the character encoding to use when reading from the file. See CharEncoding. If unspecified, the HTTP "charset" parameter from the HttpHeaders.content-type will be used if it exists. If it does not exist, the character encoding is interpreted, if possible, from the first few bytes in the stream. When this is not possible, the default character encoding, CharEncoding.utf8, is used.
buffer-size: Minimum number of chars to be buffered. If buffer-size and unread-size are both 0, tries to make an unbuffered stream if possible.
unread-size: Minimum number of chars to be efficiently unreadable. If buffer-size and unread-size are both 0, tries to make an unbuffered stream if possible.
request-headers: Headers to be sent with the request.
auto-redirect?: If true, the request will be automatically redirected depending on status in response.
always-return-response-headers?: Overrides the default behavior when status in response header is not status-ok. Instead of raising an exception, returns a stream to allow access to response headers. Starting at version 1.7, the returned stream allows access to the response body as well as the response headers. As a consequence, the caller must call HttpTextInputStream.close when done so the resources associated with the connection can be reclaimed.
event-handler: EventHandler that must take a AsyncFileOpenEvent, at least one must be provided.
...: More optional EventHandlers that must take a AsyncFileOpenEvent.

Returns

Returns the AsyncFileOpener which can control the asynchronous open.

Notes

See also HttpFile.http-async-read-open.


async-submit-open-byte (method)
public {HttpForm.async-submit-open-byte
    submit-name:#String = null,
    submit-value:#String = null,
    buffer-size:int = {calculate-instances-per-memory-size default-buffer-memory-size, byte },
    unread-size:int = {min 4, buffer-size div 4},
    request-headers:#HttpRequestHeaders = null,
    auto-redirect?:bool = true,
    always-return-response-headers?:bool = false,
    event-handler:EventHandler,
    ...:EventHandler
}:AsyncFileOpener

Asynchronously submits an HttpForm for byte input, and calls the provided event handlers with an AsyncFileOpenEvent that contains either an exception or the HttpByteInputStream that was opened.

submit-name, submit-value: If submit-name and submit-value are non-null, the name/value pair is submitted with the form. Both the name and the value are URL encoded before being submitted.
buffer-size: Minimum number of chars to be buffered. If buffer-size and unread-size are both 0, tries to make an unbuffered stream if possible. If either one is not 0, a BufferedByteInputStream will be returned.
unread-size: Minimum number of chars to be efficiently unreadable. If buffer-size and unread-size are both 0, tries to make an unbuffered stream if possible. If either is not 0, a BufferedByteInputStream will be returned.
request-headers: Headers to be sent with the request.
auto-redirect?: If true, the request will be automatically redirected depending on status in response.
always-return-response-headers?: Overrides the default behavior when status in response header is not status-ok. Instead of raising an exception, returns a stream to allow access to response headers. Starting at version 1.7, the returned stream allows access to the response body as well as the response headers. As a consequence, the caller must call HttpByteInputStream.close when done so the resources associated with the connection can be reclaimed.
event-handler: EventHandler that must take an AsyncFileOpenEvent; at least one must be provided.
...: More optional EventHandlers that must take an AsyncFileOpenEvent.

Returns

Returns the AsyncFileOpener which can control the asynchronous open.

Notes

See also HttpFile.http-async-read-open-byte.


non-keyword-init-arg (method)
public {HttpForm.non-keyword-init-arg a:any}:void

Invoked when InitRestArgParser.process-rest-args encounters a non-keyword argument.

Description

Visual's implementation of this method will first attempt to interpret the input to this method as meta-data to be associated with the object. For example, EventHandlers and DataBindings to be associated with the object are recognized and the appropriate steps are taken to attach them to the object.

Any input that cannot be understood as meta-data is assumed to be contents to be added to the Visual and passed to Visual.add-from-init-args.

Overriding

Override this method to accept additional meta-data associated with the object. Implementations should typically invoke the super implementation on inputs that they fail to interpret.


register-control (method)
public {HttpForm.register-control c:Control}:void

Register a Control with this ControlContainer.

Description

Controls should call this in their control-container option handler.
c: The control to register.

Overriding

Override this to keep track of the registered controls.


reset (method)
public {HttpForm.reset}:void

Resets the controls in the form to their initial values. It also removes all the data that was added to this form using the methods HttpForm.add-file, HttpForm.add-file-data or HttpForm.add-string-param. This method then calls Dialog.reset.

Any HttpFormParams that where added during the construction of this HttpForm will not be removed.

Notes

Only the controls that have a non-null name will be set to their initial values. However all the controls in the form will be sent a Reset event.

The procedure reset-button can be used to easily add a standard reset button to a form.


reset-all (method)
public {HttpForm.reset-all}:void

Resets the controls in the form to their initial values. It also removes all the data that was added to this form using the methods HttpForm.add-file, HttpForm.add-file-data or HttpForm.add-string-param including the HttpFormParams that where added when constructing this HttpForm. This method then calls Dialog.reset.

Notes

Only the controls that have a non-null name will be set to their initial values. However all the controls in the form will be sent a Reset event.


submit (method)
public {HttpForm.submit
    submit-name:#String = null,
    submit-value:#String = null
}:void

Submits the form and browses to HttpForm.form-action.

Notes

The procedure submit-button can be used to easily add a standard submit button to a form.
submit-name, submit-value: If submit-name and submit-value are non-null, the name/value pair is submitted with the form. Both the name and the value are URL encoded before being submitted.


submit-open (method)
public {HttpForm.submit-open
    submit-name:#String = null,
    submit-value:#String = null,
    character-encoding:CharEncoding = CharEncoding.none-specified,
    buffer-size:int = {calculate-instances-per-memory-size default-buffer-memory-size, char },
    unread-size:int = {min 4, buffer-size div 4},
    request-headers:#HttpRequestHeaders = null,
    auto-redirect?:bool = true,
    always-return-response-headers?:bool = false
}:HttpTextInputStream

Submits the HttpForm and obtains the response as a text stream.

submit-name, submit-value: If submit-name and submit-value are non-null, the name/value pair is submitted with the form. Both the name and the value are URL encoded before being submitted.
character-encoding: Indicates the character encoding to use when reading from the text stream. See CharEncoding. If unspecified, the HTTP "charset" parameter from the HttpHeaders.content-type will be used if it exists. If it does not exist, the character encoding is interpreted, if possible, from the first few bytes in the stream. When this is not possible, the default character encoding, CharEncoding.windows-latin-1, is used.
buffer-size: Minimum number of chars to be buffered. If buffer-size and unread-size are both 0, tries to make an unbuffered stream if possible.
unread-size: Minimum number of chars to be efficiently unreadable. If buffer-size and unread-size are both 0, tries to make an unbuffered stream if possible.
request-headers: Headers to be sent with the request.
auto-redirect?: If true, the request will be automatically redirected depending on status in response.
always-return-response-headers?: Overrides the default behavior when status in response header is not status-ok. Instead of raising an exception, returns a stream to allow access to response headers. Starting at version 1.7, the returned stream allows access to the response body as well as the response headers. As a consequence, the caller must call HttpTextInputStream.close when done so the resources associated with the connection can be reclaimed.

Returns

Returns the HttpTextInputStream it opens.

Description

The returned stream inherits from HttpInputStreamInfo. HttpInputStreamInfo provides an interface to access the response headers.

Notes

See also HttpFile.http-read-open.


submit-open-byte (method)
public {HttpForm.submit-open-byte
    submit-name:#String = null,
    submit-value:#String = null,
    buffer-size:int = {calculate-instances-per-memory-size default-buffer-memory-size, byte },
    unread-size:int = {min 4, buffer-size div 4},
    request-headers:#HttpRequestHeaders = null,
    auto-redirect?:bool = true,
    always-return-response-headers?:bool = false
}:HttpByteInputStream

Submits the form and obtains the response as a byte stream.

submit-name, submit-value: If submit-name and submit-value are non-null, the name/value pair is submitted with the form. Both the name and the value are URL encoded before being submitted.
buffer-size: Minimum number of chars to be buffered. If buffer-size and unread-size are both 0, tries to make an unbuffered stream if possible. If either one is not 0, a BufferedByteInputStream will be returned.
unread-size: Minimum number of chars to be efficiently unreadable. If buffer-size and unread-size are both 0, tries to make an unbuffered stream if possible. If either is not 0, a BufferedByteInputStream will be returned.
request-headers: Headers to be sent with the request.
auto-redirect?: If true, the request will be automatically redirected depending on status in response.
always-return-response-headers?: Overrides the default behavior when status in response header is not status-ok. Instead of raising an exception, returns a stream to allow access to response headers. Starting at version 1.7, the returned stream allows access to the response body as well as the response headers. As a consequence, the caller must call HttpByteInputStream.close when done so the resources associated with the connection can be reclaimed.

Returns

Returns the HttpByteInputStream it opens.

Description

The returned stream inherits from HttpInputStreamInfo. HttpInputStreamInfo provides an interface to access the response headers.

Notes

See also HttpFile.http-read-open-byte.


unregister-control (method)
public {HttpForm.unregister-control c:Control}:void

Unregister a Control from this ControlContainer.

Description

Controls should call this in their control-container option handler when they are removed from a container.
c: The control to unregister.

Overriding

Override this to keep track of the registered controls.