Encoding Property  
 

Gets and sets the content encoding type.

Syntax

object.Encoding = [type ]

Remarks

The Encoding property explicitly sets the type of encoding used when optional parameter data is submitted with a request for a resource. By default, data is URL encoded and the content type will be designated as application/x-www-form-urlencoded. The following encoding types are supported:

Value Constant Description
0 httpEncodingNone No encoding will be applied to the content of a request, and no Content-Type header will be generated.
1 httpEncodingURL URL encoding will be applied to the content of a request, and a Content-Type header will be generated with the value "application/x-www-form-urlencoded"
2 httpEncodingXML URL encoding will be applied to the content of a request, EXCEPT that spaces will not be replaced by '+'. This encoding type is intended for use with XML parsers that do not recognize '+' as a space. A Content-Type header will be generated with the value "application/x-www-form-urlencoded".

If an application must specify its own Content-Type header, this property must be set to httpEncodingNone to prevent the control from replacing the header value when the request is sent to the server. Changes to this property and any calls to the SetHeader method should be made after the connection to the server has been established, immediately before the resource is requested.

Data Type

Integer (Int32)

See Also

HeaderField Property, HeaderValue Property, GetHeader Method, SetHeader Method