rewrite without pecl http extension