READ_CONTENT

Obtain additional data from the last HTTP request. It cannot be used in conjunction with the file operations.

UHTTP.READ_CONTENT(Content)

Parameters

Parameter

Type

Direction

Description

Content

string

OUT

Additional content returned.

Return Values

Values Returned in $status

Value

Meaning

1

More data to be read

-10

No unread response data in the buffer

-12

Internal error occurred

Description

The READ_CONTENT operation is used to obtain additional data from the last HTTP request. This operation only needs to be used to read HTTP request responses exceeding 10 MB.

The READ_CONTENT operation can be called only if there are pending results from a prior SEND request. The READ_CONTENT operation can be called zero or more times after calling the SEND operation.

Sending an HTTP Request and Reading the Response

The following example demonstrates how send an HTTP request and read the response when it exceeds 10 MB.

entry uHttpCallOut
params
  string pUrl         : IN
  string pUsername    : IN
  string pPassword    : IN
  string pHttpHeader  : INOUT
  string pHttpContent : INOUT
endparams
variables
  string vMoreContent, vResponse
endvariables

  activate "UHTTP".send(pUrl, "GET", pUsername, pPassword, pHttpHeader, pHttpContent, vResponse)
  while ($status = 1)
    activate "UHTTP".read_Content(vMoreContent)      ; get more data from UHTTP buffer
    pHttpContent = $concat(pHttpContent, vMoreContent)
  endwhile
  if ($status < 0)
    message/error $concat("UHTTP error:%%^", $status)
  else
    message/info $concat("UHTTP success:%%^", $status)  ; 200
  endif
  return 0
end