public class

UrlEncodedEntity

extends Object
implements RequestEntity
java.lang.Object
   ↳ chan.http.UrlEncodedEntity

Class Overview

URL Encoded implementation of RequestEntity.

Summary

Public Constructors
UrlEncodedEntity()

Default constructor for an UrlEncodedEntity.

UrlEncodedEntity(String... alternation)

Constructor for an UrlEncodedEntity.

Public Methods
void add(String name, String value)

Add string field to entity with given name and value.

RequestEntity copy()

Returns a deep copy of this RequestEntity instance.

long getContentLength()

Returns a content length of entity.

String getContentType()

Returns a content type of entity.

void setEncoding(String charsetName)

Changes encoding type for this entity.

void write(OutputStream output)

Writes entity to given output.

[Expand]
Inherited Methods
From class java.lang.Object
From interface chan.http.RequestEntity

Public Constructors

public UrlEncodedEntity ()

Default constructor for an UrlEncodedEntity.

public UrlEncodedEntity (String... alternation)

Constructor for an UrlEncodedEntity.

Parameters
alternation String: Alternation of string field's names and values (name, value, name, value...).

Public Methods

public void add (String name, String value)

Add string field to entity with given name and value.

Parameters
name String: Field name.
value String: Field value.

public RequestEntity copy ()

Returns a deep copy of this RequestEntity instance.

Returns
RequestEntity Copy of this entity.

public long getContentLength ()

Returns a content length of entity.

Returns
long Content length.

public String getContentType ()

Returns a content type of entity.

Returns
String Content type.

public void setEncoding (String charsetName)

Changes encoding type for this entity. By default UTF-8 is used.

Parameters
charsetName String: Charset name.

public void write (OutputStream output)

Writes entity to given output.

Parameters
output OutputStream: Output stream.
Throws
IOException