An object with this interface is usually created by a device script and passed to IHttpClient.request method to customize its behavior.
interface IHttpRequestOptions {
// Properties
${headers}?: string[] | ${IHttpHeader}[];
${body}?: string | number[] | Uint8Array;
${encoding}?: ${UnicodeEncoding};
${mediaType}?: string;
}
// This interface is not available in managed environment
// This interface is not available in native environment
headers?: string[] | ${IHttpHeader}[];
// This property is not available in managed environment
// This property is not available in native environment
HTTP headers, either as a string array or array of IHttpHeader objects. If string array is used, each string must be of the form Name: Value
.
body?: string | number[] | Uint8Array;
// This property is not available in managed environment
// This property is not available in native environment
HTTP request body, can be a string, array or a byte array
encoding?: ${UnicodeEncoding};
// This property is not available in managed environment
// This property is not available in native environment
Encoding for string body. Used only if body
is a string. Defaults to UTF8.
mediaType?: string;
// This property is not available in managed environment
// This property is not available in native environment
Body media type. Defaults to text/plain
. Used only if body
is a string. Defaults to UTF8.