Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new httpPost2/httpPostUrl2 functions
The new httpPost2 and httpPostUrl2 functions are a strip-down version of httpPost and httpPostUrl, where the HTTP response object is returned directly to the caller for it to consume it, instead of being processed internally by the function. This change makes the new functions behave more like the httpGet and httpGetUrl functions, which already return the response back to the caller. This change not only aligns these two sets of functions, but also gives users the ability to stream the response from a POST request instead of getting the accumulated result in memory. Although normally POST requests shouldn't result in long responses, it is still possible for one to return a large body that doesn't fit in memory. In order to avoid changing the behavior and return type of the old functions, new ones have been introduced with the "2" suffix. We have previously used this system to write different versions of functions that were not optimally designed the first time, but whose behavior couldn't be changed without potentially breaking existing code (e.g., ngamsDb.query2). Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
- Loading branch information