com.HTTPPart.setHeader

Setter to handle HTTP multipart headers.

Syntax

setHeader(
   name STRING,
   value STRING)
  1. name is the multipart header name.
  2. value is the multipart header value (such as HTTP headers).

Usage

Setter to handle HTTP multipart headers.

For instance, when you send a multipart image, you should specify the image mime type with this header method. If the image is a png, you have to do part.setHeader("Content-Type","image/png"), which lets the peer know the format of the attached file it has to process.

Note: In case of related multipart (i.e., the part is multipart/related and set via the com.HTTPRequest.setMultipartType("related",NULL,NULL)), it is mandatory to set a unique Content-ID header. To set up a unique Content-ID header, you can use the security.RandomGenerator.CreateUUIDString method for that.

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).

Example

CALL req.setHeader("MyClientHeader","Hello")