Extract http stubs into method