C# Class Encog.Util.HTTP.FormUtility

FormUtility: This class is used to construct responses to HTML forms. The class supports both standard HTML forms, as well as multipart forms.
Show file Open project: encog/encog-silverlight-core Class Usage Examples

Public Methods

Method Description
Add ( String name, String v ) : void

Add a regular text field to either a regular or multipart form.

AddFile ( String name, String file ) : void

Add a file to a multipart form. Default mime type to application/octet-stream.

AddFile ( String name, String file, String type ) : void

Add a file to a multipart form.

Complete ( ) : void

Complete the building of the form.

Encode ( String str ) : String

Encode the specified string. This encodes all special characters.

FormUtility ( Stream os, String boundary ) : System

Prepare to access either a regular, or multipart, form.

GetBoundary ( ) : String

Generate a boundary for a multipart form.

Protected Methods

Method Description
RandomString ( ) : String

Generate a random string, of a specified length. This is used to generate the multipart boundary.

Writeln ( String str ) : void

Write a string, with a carriage return and linefeed.

Private Methods

Method Description
Boundary ( ) : void

Generate a multipart form boundary.

Newline ( ) : void

Create a new line by displaying a carriage return and linefeed.

Write ( String str ) : void

Write the specified string, without a carriage return and line feed.

WriteName ( String name ) : void

Write the name element for a multipart post.

Method Details

Add() public method

Add a regular text field to either a regular or multipart form.
public Add ( String name, String v ) : void
name String The name of the field.
v String The value of the field.
return void

AddFile() public method

Add a file to a multipart form. Default mime type to application/octet-stream.
public AddFile ( String name, String file ) : void
name String The field name.
file String The file to attach.
return void

AddFile() public method

Add a file to a multipart form.
public AddFile ( String name, String file, String type ) : void
name String The field name.
file String he file to attach.
type String The mime type
return void

Complete() public method

Complete the building of the form.
public Complete ( ) : void
return void

Encode() public static method

Encode the specified string. This encodes all special characters.
public static Encode ( String str ) : String
str String The string to encode.
return String

FormUtility() public method

Prepare to access either a regular, or multipart, form.
public FormUtility ( Stream os, String boundary ) : System
os Stream The stream to output to.
boundary String The boundary to be used, or null if this is /// not a multipart form.
return System

GetBoundary() public static method

Generate a boundary for a multipart form.
public static GetBoundary ( ) : String
return String

RandomString() protected static method

Generate a random string, of a specified length. This is used to generate the multipart boundary.
protected static RandomString ( ) : String
return String

Writeln() protected method

Write a string, with a carriage return and linefeed.
protected Writeln ( String str ) : void
str String The string to write.
return void