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

3.5.1 COBW3_PUT_HEAD

This subroutine outputs the specified optional HTTP header.

When outputting an HTML document of a Web page for processing result output, there is no need to output the header using this subroutine because the header is output as text/html by ISAPI Subroutines. Use this subroutine only when files (such as plain text) other than HTML documents are output or any HTTP header should be output to the WWW Browser.

Note

Use this subroutine before using COBW3_PUT_HTML or COBW3_PUT_TEXT. If this subroutine is used after COBW3_PUT_HTML or COBW3_PUT_TEXT is used even once, the specified information will become invalid.

If any value other than the default value is set to COBW3-CONTENT-TYPE or COBW3-STATUS-CODE, do not change the value.

How to write

CALL "COBW3_PUT_HEAD" USING COBW3.

Data setting for calling

COBW3-PUT-HEAD

Set the string to be output to the HTTP header.

COBW3-PUT-HEAD-LENGTH [optional]

If the string has a valid blank at the end, set the length (byte length) of the string including the blank.

Value

Meaning

0

Outputs the string using the length up to the last character excluding the blank. However, if COBW3-PUT-HEAD is completely blank, the string length is set to zero (line feed only) for processing.

1 to 512

Outputs the string using the specified string length.

COBW3-CONTENT-TYPE [optional]

Set the file type (attribute) (Content-type) of response data. If this subroutine is called multiple times, the first specification becomes valid.

Condition name

Value

Meaning

-

LOW-VALUE

Outputs an HTML document.

COBW3-CONTENT-TYPE-NON

HIGH-VALUE

Do not output the Content-type.

COBW3-CONTENT-TYPE-HTML

"text/html"

Outputs an HTML document.

COBW3-CONTENT-TYPE-TEXT

"text/plain"

Outputs a text file.

-

Any string

Specifies any string to the Content-type of the HTTP header.

COBW3-STATUS-CODE [optional]

Set the status code (Status-code). If this subroutine is called multiple times, the first specification becomes valid.

Condition name

Value

Meaning

-

LOW-VALUE

Outputs the normal end code "200" to the Status-code.

COBW3-STATUS-CODE-NON

HIGH-VALUE

Do not output the Status-code.

COBW3-STATUS-CODE-200

"200"

Outputs the normal end code "200" to the Status-code.

-

Any code

Outputs any Status-code.

Note

Avoid the use of COBW3-CONTENT-TYPE-NON and COBW3-STATUS-CODE-NON where possible. In CGI, the specification of -NON is valid because the Content-type can be specified from a batch file. However, in DLL applications such as Internet Server Applications, -NON cannot be specified from outside.

Also in Internet Server Applications, if -NON is specified and the Content-type or Status-code is not specified, the operation is undefined.