HttpFormParam (class)
public abstract HttpFormParam
Import from: CURL.GUI.STANDARD. Defined in package CURL.IO.HTTP.
Direct Known Subclasses: HttpFormBytesParam, HttpFormFilesParam, HttpFormStringParam

Generic class to hold an HTTP form parameter to be added to a HttpFormData.

Notes

Although additional non-abstract subclasses can be created if needed, use supplied non-abstract classes, HttpFormStringParam, HttpFormBytesParam, and HttpFormFilesParam for most uses.

Constructors
default:Create a HttpFormParam with the provided name.
constructor public {HttpFormParam.default name:String}
Properties
name:The name of this HttpFormParam.
field public constant HttpFormParam.name:String
Methods
request-data-multipart-bytes:Returns the data for this HttpFormParam in "multipart/form-data" (aka HttpFormData.multipart-mime-type) style encoding, as an Array-of byte, including appropriate MIME headers.
public abstract {HttpFormParam.request-data-multipart-bytes
    default-character-encoding:CharEncoding = CharEncoding.ascii
}:{Array-of byte}
request-data-urlencoded-bytes:Returns the data for this HttpFormParam in "application/x-www-form-urlencoded" (aka HttpFormData.urlencoded-mime-type) style encoding, as an Array-of byte.
public abstract {HttpFormParam.request-data-urlencoded-bytes
    default-character-encoding:CharEncoding = CharEncoding.ascii
}:{Array-of byte}
request-data-urlencoded-string:Returns the data for this HttpFormParam in "application/x-www-form-urlencoded" (aka HttpFormData.urlencoded-mime-type) style encoding, as a String.
public {HttpFormParam.request-data-urlencoded-string
    default-character-encoding:CharEncoding = CharEncoding.ascii
}:String
Methods inherited from Object: object-describe, object-describe-for-debugging, object-serialize

Constructor Details
default (constructor)
public {HttpFormParam.default name:String}

Create a HttpFormParam with the provided name.



Property Details
name (field)
public constant HttpFormParam.name:String

The name of this HttpFormParam.



Method Details
request-data-multipart-bytes (method)
public abstract {HttpFormParam.request-data-multipart-bytes
    default-character-encoding:CharEncoding = CharEncoding.ascii
}:{Array-of byte}

Returns the data for this HttpFormParam in "multipart/form-data" (aka HttpFormData.multipart-mime-type) style encoding, as an Array-of byte, including appropriate MIME headers.

default-character-encoding: CharEncoding used to encode the strings used for the MIME headers.

Overriding

Overridden with a real implementation by non-abstract subclasses.

Notes

Used by HttpFormData.request-data, when HttpFormData.mime-type is HttpFormData.multipart-mime-type.


request-data-urlencoded-bytes (method)
public abstract {HttpFormParam.request-data-urlencoded-bytes
    default-character-encoding:CharEncoding = CharEncoding.ascii
}:{Array-of byte}

Returns the data for this HttpFormParam in "application/x-www-form-urlencoded" (aka HttpFormData.urlencoded-mime-type) style encoding, as an Array-of byte.

default-character-encoding: The CharEncoding used to encode strings into bytes after changing dangerous characters into % escape sequences as needed. Some subclasses may use this only for encoding '=', and use their own character-encoding for the name and value. (Dangerous characters in this case are generally just '=', '&', ' ', ' ', ' ', and ' ', but more may be encoded.)

Overriding

Overridden with a real implementation by non-abstract subclasses.

Notes

Used by HttpFormData.request-data, when HttpFormData.mime-type is HttpFormData.urlencoded-mime-type.


request-data-urlencoded-string (method)
public {HttpFormParam.request-data-urlencoded-string
    default-character-encoding:CharEncoding = CharEncoding.ascii
}:String

Returns the data for this HttpFormParam in "application/x-www-form-urlencoded" (aka HttpFormData.urlencoded-mime-type) style encoding, as a String.

default-character-encoding: CharEncoding used to encode any byte data that the implementation may need to encode after escaping the bytes into % escape sequences as needed. Some subclasses may use this only for encoding the '=', and use their own character-encoding for the name and value. (Most ASCII punctuation and control characters, and all non-ASCII characters, should be considered dangerous in this respect.)

Overriding

Override if default implementation, which calls HttpFormParam.request-data-urlencoded-bytes and then decodes it back into a String, is not adequate.