SocketTools .NET Edition

HttpClient.HttpOptions Enumeration

Specifies the options that the HttpClient class supports.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

[Visual Basic]
<Flags>
Public Enum HttpClient.HttpOptions
[C#]
[Flags]
public enum HttpClient.HttpOptions

Remarks

The HttpClient class uses the HttpOptions enumeration to specify one or more options to be used when establishing a connection with a remote host. Multiple options may be specified if necessary.

Members

Member Name Description Value
optionNone No option specified. 0
optionNoCache This instructs the server to not return a cached copy of the resource. When connected to an HTTP 1.0 or earlier server, this directive may be ignored. 1
optionKeepAlive This instructs the server to maintain a persistent connection between requests. This can improve performance because it eliminates the need to establish a separate connection for each resource that is requested. If the server does not support the keep-alive option, the client will automatically reconnect when each resource is requested. Although it will not provide any performance benefits, this allows the option to be used with all servers. 2
optionRedirect This option specifies that the client should automatically handle resource redirection. If the server indicates that the requested resource has moved to a new location, the client will close the current connection and request the resource from the new location. Note that it is possible that the redirected resource will be located on a different server. 4
optionProxy This option specifies that the client should use the default proxy configuration for the local system. If the system is configured to use a proxy server, then the connection will be automatically established through that proxy; otherwise, a direct connection to the server is established. The local proxy configuration can be changed using the system Control Panel. 8
optionErrorData This option specifies that the client should return the content of an error response from the server, rather than returning an error code. Note that this option will disable automatic resource redirection, and should not be used with optionRedirect. 16
optionTunnel This option specifies that a tunneled TCP connection and/or port-forwarding is being used to establish the connection to the server. This changes the behavior of the client with regards to internal checks of the destination IP address and remote port number, default feature selection and how the connection is established. This option also forces all connections to be outbound and enables the firewall compatibility features in the client. 1024
optionTrustedSite This option specifies that the server is trusted. The server certificate will not be validated and the connection will always be permitted. This option only affects connections using either the SSL or TLS protocols. 2048
optionSecure This option specifies that the client should attempt to establish a secure connection with the server. Note that the server must support secure connections using either the SSL or TLS protocol. 4096
optionFreeThread This option specifies that class methods may be called from any thread, and not only the thread that established the connection. Using this option disables certain internal safety checks that are made by the class and may result in unexpected behavior unless you ensure that access to the class instance is synchronized across multiple threads. 524288

Requirements

Namespace: SocketTools

Assembly: SocketTools.HttpClient (in SocketTools.HttpClient.dll)

See Also

SocketTools Namespace