Funtions for "HTTP gateway" implemented, they provide better
error on http responses and pastebin bad responses