change http req to rest client