This also needs to be implemented into the core lib, then imported
into the http-request calls.