Type (-TY or -TYPE)

Use the Type adapter command (-TY or -TYPE) to specify the type of content that is contained in the body of the HTTP request. The default type is application/octet-stream. See "Known Limitations" on page 1-1 for additional information.

When you send a SOAP-based HTTP request, the encoding of the content of the HTTP request might require you to specify the charset parameter of the -TYPE command. The default encoding is ISO-8859-1, as originally specified by RFC 2616. The SOAP adapter requires a UTF-8 encoded response from the HTTP server, but the request can be in any Western or UTF-8 encoded format.


-TYPE content_type [charset=encoding]
Option
Description
content_type
The default content type is application/octet stream. You might use other types. But do not use compound types such as multipart.
charset
Specifies the encoding of the content that is contained in the body of the HTTP request. The charset keyword is optional. If you omit it, the default encoding is ISO-8859-1.

When you specify the charset keyword on the HTTP adapter command line, enclose both the content_type and the charset keyword and value pair within a set of double quotation marks ("content_type charset=encoding").

When you specify the charset keyword on a SOAP adapter command line, enclose both the content_type and the charset keyword and value pair within two sets of double quotation marks (""content_type charset=encoding"") to avoid parsing errors.

The following command line notifies the HTTP Server that the content is UTF-8 data:
-TYPE "text/xml; charset=utf-8"
The following command line uses a SOAP adapter GET request, and notifies the HTTP Server that the content is UTF-8 data. Note that both the content_type and the charset keyword and value pair are enclosed within two sets of double quotation marks:
=GET("SOAP", "-T -SA http://localhost/WebService/test -TRANSPORT 'HTTP(-HDRI+ -T -TYPE ""text/xml; charset=utf-8"" -METHOD POST -URL http://localhost/WebService/test)' ", PACKAGE(SoapRequest))