Description
Finishes sending the data with POST method.
Applies to
HTTPClient object
Syntax
objectname.PostDataEnd ( )
Argument |
Description |
---|---|
objectname |
The name of the HTTPClient object for which you want to end posting data. |
Return value
Integer.
Returns values as follows. If any argument’s value is null, the method returns null.
1 -- Success
-1 -- General error
-2 -- Timed out
Examples
Integer i, li_PackCount, li_rc Blob lblb_NextData String ls_ReturnJson HttpClient lnv_HttpClient lnv_HttpClient = Create HttpClient // Construct a POST request lnv_HttpClient.SetRequestHeader("Content-Length", "9999999") ... // Start posting data and request information if lnv_HttpClient.PostDataStart("http://demo.appeon.com/PB/webapi_client/employee/102/photo") = 1 then for i = 1 to li_PackCount ... li_rc = lnv_HttpClient.PostData(lblb_NextData, 1024) if li_rc <> 1 then exit next end if if li_rc = 1 then li_rc = lnv_HttpClient.PostDataEnd() end if // Obtain the response data if li_rc = 1 and lnv_HttpClient.GetResponseStatusCode() = 200 then lnv_HttpClient.GetResponseBody(ls_ReturnJson) end if
See also