HTTP_INPUT$ (1) (only available on Wx PLC firmware >= F94.4)
Purpose To return the data string that the HTTP web server responded to the client (PLC).
Examples D$ = HTTP_INPUT$(1)
Comments: The response data buffer maximum length is 2048 bytes. However, in order for TBASIC program to be able to process the data line by line, each execution of the HTTP_INPUT$(1) command will return what is essentially a line of data from the data buffer. A line of data is defined as a string of characters that is terminated either by a "Carriage Return (CR), a Line Feed (LF) or a pair of CR+LF characters. The CR or LF characters however will not become part of the returned string.

Note: The last line in the data buffer will be read regardless of whether it is terminated by a CR or LF character.

The TBASIC program can use the HTTP_STATUS(2) command to check if there are anymore unread data in the response data buffer. When HTTP_STATUS(2) returns a zero it indicates that all data in the data buffer have already been read.
See Also HTTP_CONFIG(1), HTTP_COMMAND, HTTP_STATUS(n), HTTP_POST_BUF

backbutton.gif (507 bytes)  Basic to TBASIC Reference Manual