fixing the https call to handle a buffer