added the code of http fetch