Top
NetCOBOL V11.0 CGI Subroutines User's Guide
FUJITSU Software

3.5.1 COBW3_PUT_HEAD

This subroutine outputs an arbitrary HTTP header that is specified.

When an HTML document for a processing result output Web page is output, the CGI subroutine outputs its header as "text/html." Therefore, the header need not be output by using this subroutine. However, when a non-HTML document such as plain text is to be output or an arbitrary HTTP header is to be output to a WWW server, this subroutine must be used.

Note

This subroutine must be used before COBW3_PUT_HTML or COBW3_PUT_TEXT is used. If this subroutine is used after COBW3_PUT_HTML or COBW3_PUT_TEXT are executed, the specified header is invalidated.

If a value other than the default value is specified in COBW3-CONTENT-TYPE, COBW3-STATUS-CODE, or COBW3-CONTENT-LENGTH, the specified value must not be changed later.

Format

CALL "COBW3_PUT_HEAD" USING COBW3.

Data setting at calling

COBW3-PUT-HEAD

Specify a character string that is to be output as a HTTP header.

COBW3-PUT-HEAD-LENGTH [Optional]

To output a header that is a character string containing a valid blank at the end, specify the total character string length (byte length) that contains the blank.

Value

Explanation

0

Outputs a character string up to the last character other than the blank. When the COBW3-PUT-HEAD character string consists of only blanks, the character string length is assumed to be 0 (only line feed occurs).

1 to 512

Outputs a character string of the specified character string length.

COBW3-CONTENT-TYPE [Optional]

Specify the file type attribute (Content-type) of the response data.

If this subroutine was called two or more times, only the first specified Content-type is valid.

Condition name

Value

Explanation

-

LOW-VALUE

Outputs an HTML document.

COBW3-CONTENT-TYPE-NON

HIGH-VALUE

Does not output the Content-type information.

COBW3-CONTENT-TYPE-HTML

"text/html"

Outputs an HTML document.

COBW3-CONTENT-TYPE-TEXT

"text/plain"

Outputs a text file.

-

Arbitrary character string

Specifies an arbitrary character string in the Content-type field of the HTTP header.

COBW3-STATUS-CODE [Optional]

Specify a status code (Status-code).

If this subroutine was called two or more times, only the first specified Status-code is valid.

Condition name

Value

Explanation

-

LOW-VALUE

Outputs a normal end code ("200") as the Status-code.

COBW3-STATUS-CODE-NON

HIGH-VALUE

Does not output a Status-code.

COBW3-STATUS-CODE-200

"200"

Outputs a normal end code ("200") as the Status-code.

-

Arbitrary code

Outputs an arbitrary Status-code.

Processing result data

None