javascript wrapper function for http.request that returns parsed data in callback