httpGet: Difference between revisions

354 bytes added ,  22 November 2020
no edit summary
No edit summary
 
No edit summary
Line 13: Line 13:


If parameter <code>postData</code> is a blank string, then the GET request method is used, otherwise the POST request method is used.
If parameter <code>postData</code> is a blank string, then the GET request method is used, otherwise the POST request method is used.
|callback3Syntax = ArrayBuffer receivedData
|callback3Syntax = ArrayBuffer/String receivedData
|callback3Text = This callback function can be called multiple times, or just once.
|callback3Text = This callback function can potentially be called multiple times for the same request.
|callback3Parameter1 = ArrayBuffer receivedData The data received, which could be all of the data or just 1 byte.
|callback3Parameter1 = ArrayBuffer/String receivedData The data received, which could be all of the data or just 1 byte.<br>ArrayBuffer is used in JavaScript, String is used in other scripting languages.
|callback4Syntax = int curlErrorCode, int httpResponseCode
|callback4Syntax = int curlErrorCode, int httpResponseCode
|callback4Parameter1 = int curlErrorCode The CURL error code. 0 means success. [https://curl.haxx.se/libcurl/c/libcurl-errors.html CURL Error Codes]
|callback4Parameter1 = int curlErrorCode The CURL error code. 0 means success. [https://curl.haxx.se/libcurl/c/libcurl-errors.html CURL Error Codes]
Line 21: Line 21:
|compat1 = In server version 1.1.22 and before, there was an issue where the connection would close after the '''dataReceivedCallback''' callback was called first time and did not return the received data length.
|compat1 = In server version 1.1.22 and before, there was an issue where the connection would close after the '''dataReceivedCallback''' callback was called first time and did not return the received data length.
|compat2 = In server version 1.1.22 and before, there was also an issue where the POST request method was used if the '''postData''' parameter was a blank string.
|compat2 = In server version 1.1.22 and before, there was also an issue where the POST request method was used if the '''postData''' parameter was a blank string.
|compat3 = In previous server versions, the '''dataReceivedCallback''' callback was invoked with a string parameter instead of an ArrayBuffer parameter.
|compat3 = In previous server versions, for the JavaScript scripting language, the '''dataReceivedCallback''' callback was invoked with a string parameter instead of an ArrayBuffer parameter.
|notes = You can use this function to convert a JavaScript ArrayBuffer to a JavaScript String:
{{CodeSyntax|function ab2str(buf) {
  return String.fromCharCode.apply(null, new Uint8Array(buf));
} }}
}}
}}
6,834

edits