Convert curl in shell scripts into using http request library

Change-Id: I2dde2a4ae0a7b3f041526c6eebf50266d683ba09
Reviewed-on: http://review.couchbase.org/37139
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Li Yang <lichenyang2@gmail.com>