PHPackages                             brunodebarros/http-request - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. brunodebarros/http-request

ActiveLibrary[HTTP &amp; Networking](/categories/http)

brunodebarros/http-request
==========================

A web crawler, built to be easily dropped into PHP applications, which behaves just like a regular web browser, interpreting location redirects and storing cookies automatically.

1.0.2(11y ago)92073MITPHPPHP &gt;=5.2.4

Since Jan 19Pushed 11y ago6 watchersCompare

[ Source](https://github.com/BrunoDeBarros/HTTP-Request)[ Packagist](https://packagist.org/packages/brunodebarros/http-request)[ Docs](https://github.com/BrunoDeBarros/HTTP-Request)[ RSS](/packages/brunodebarros-http-request/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)DependenciesVersions (4)Used By (0)

[![Latest Version](https://camo.githubusercontent.com/e2db2088272c6b73fdf756a2cd4447c0eb6936a7f07c9d05739229aee4caaf7a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6272756e6f6465626172726f732f687474702d726571756573742e7376673f7374796c653d666c61742d737175617265)](https://github.com/brunodebarros/http-request/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/2c42ef263b967988f59e30537afe2bea74ed5f1f5bc21c8934698b885530a717/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6272756e6f6465626172726f732f687474702d726571756573742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/brunodebarros/http-request)

HTTP Request 1.0
================

[](#http-request-10)

HTTP Request is a web crawler which behaves just like a regular web browser, interpreting location redirects and storing cookies automatically.

Features
--------

[](#features)

- HTTP/HTTPS Requests
- Automatic cookie and redirect handling
- GET/POST Requests

How to use it
-------------

[](#how-to-use-it)

#### Install with Composer

[](#install-with-composer)

Add `brunodebarros/http-request` to the contents of your composer.json:

```
{
    "require": {
        "brunodebarros/http-request": "dev-master"
    }
}

```

#### Then use it!

[](#then-use-it)

```
$http = new HTTP_Request();
$content = $http->request($url, $mode, $data, $save_to_file);

```

$url is the URL to access. HTTP Request supports HTTPS requests just as easily as HTTP, as long as you have OpenSSL enabled on your PHP server.

$mode is either GET or POST. If empty, a GET request will be made.

$data is an array of data to pass via GET or POST. Couldn't be simpler. If empty, no extra data will be sent in the request.

$save\_to\_file is the filename of the file where you want the output to be stored. If empty, the output will not be stored anywhere.

Examples
--------

[](#examples)

```
$http = new HTTP_Request();

# Make a simple GET Request:
$content = $http->request('http://website.com');

# Make a POST request to a HTTPS website with some data:
$content = $http->request('https://website.com/login', 'POST', array('user' => 'myusername', 'pass' => 'mypassword'));

# Make a simple GET Request and store it in a file:
$http->request('http://website.com', 'GET', array(), 'contents_of_website_dot_com.txt')

```

Why automatic cookie handling is awesome
----------------------------------------

[](#why-automatic-cookie-handling-is-awesome)

The best part about HTTP Request is that it will automatically handle location redirects and cookies. So if you POST your login details to a website's login page, and then access another page on that website, the website will believe that you are logged in, because HTTP Request will have kept the cookies. This way, you can build truly human-like web crawlers that can easily perform pretty much any action a human can.

```
$http = new HTTP_Request();

# Login to website.com
$content = $http->request('https://website.com/login', 'POST', array('user' => 'myusername', 'pass' => 'mypassword'));

# Access restricted page (because of cookie handling, you will be logged in when you request this page, without any effort on your part)
$http->request('http://website.com/page-for-logged-in-users-only');

```

What's coming.
--------------

[](#whats-coming)

I intend to make HTTP Request a whole lot more powerful. Here are some ideas I have:

1. Enhanced cookie handling (delete cookies when the server sends a request to delete the cookie, store cookies in files for future visits, etc.)
2. Enhanced redirect interpretation (make it work with HTML meta redirects, and even JavaScript redirects)
3. Chunk downloads to enable downloading very big files without going over PHP's memory\_limit.
4. If you have any ideas, create an issue. If you create an issue, I'll do everything I can to resolve it.

Suggestions, questions and complaints.
--------------------------------------

[](#suggestions-questions-and-complaints)

If you've got any suggestions, questions, or anything you don't like about HTTP Request, create an issue. I'd really appreciate your feedback. Feel free to fork this project, if you want to contribute to it.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~38 days

Total

3

Last Release

4103d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/09f83048fb2fd781448b09e26ed424a95666bf30850b9d3945d0202b1cdcb40b?d=identicon)[pocketarc](/maintainers/pocketarc)

---

Top Contributors

[![pocketarc](https://avatars.githubusercontent.com/u/5393?v=4)](https://github.com/pocketarc "pocketarc (19 commits)")

---

Tags

httpcrawler

### Embed Badge

![Health badge](/badges/brunodebarros-http-request/health.svg)

```
[![Health](https://phpackages.com/badges/brunodebarros-http-request/health.svg)](https://phpackages.com/packages/brunodebarros-http-request)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.1B3.8k](/packages/guzzlehttp-psr7)[psr/http-message

Common interface for HTTP messages

7.0k1.1B6.6k](/packages/psr-http-message)[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k728.6M2.5k](/packages/psr-http-factory)[psr/http-client

Common interface for HTTP clients

1.7k714.1M2.8k](/packages/psr-http-client)[symfony/http-client

Provides powerful methods to fetch HTTP resources synchronously or asynchronously

2.0k330.1M4.6k](/packages/symfony-http-client)[psr/link

Common interfaces for HTTP links

2.5k149.8M82](/packages/psr-link)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
