com.HttpRequest.setCharset

Defines the charset used when sending text or XML.

Syntax

setCharset(
   charset STRING )
  1. charset defines the character set to use.

Usage

Defines the character set used when sending an HTTP request.

By default, no character set information will be transmitted in the HTTP header. This is also the case when specifying NULL as parameter for this method.

If no character set is specified in HTTP headers, UTF-8 will implicitly be used as defined by the HTTP standards.
Note:

Default charset for web services: The default character encoding for web service communication is UTF-8. If the request payload is in JSON format, you do not need to explicitly set the charset, as UTF-8 is assumed by default. For other content types (such as XML or plain text), you may need to explicitly set the charset to ensure correct encoding. For example: CALL request.setCharset("UTF-8")

In case of error, the method throws an exception and sets the status variable. Depending on the error, a human-readable description of the problem is available in the sqlca.sqlerrm register. See Error handling in GWS calls (status).