2017 © Pedro Peláez
 

library url-fetcher

Class providing methods to make http requests

image

atk14/url-fetcher

Class providing methods to make http requests

  • Wednesday, April 18, 2018
  • by yarri
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1,457 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 46 % Grown

The README.md

UrlFetcher

UrlFetcher is a PHP class providing methods to make http requests, (*1)

Basic usage

$fetcher = new UrlFetcher("http://www.example.com/content.dat");

if(!$fetcher->found()){
  echo $fetcher->getErrorMessage();
  exit(1);
}

$content = $fetcher->getContent();

$status_code = $fetcher->getStatusCode(); // e.g 200
$content_type = $fetcher->getContentType(); // e.g. "application/pdf"
$request_headers = $fetcher->getRequestHeaders();
$response_headers = $fetcher->getResponseHeaders();

HTTP basic authentication or non-standard port can be specified within the URL., (*2)

$fetcher = new UrlFetcher("https://username:password@www.example.com:444/private/content.dat");
if($fetcher->found()){
  echo $fetcher->getContent();
}else{
  echo $fetcher->getErrorMessage();
}

Make a POST requests

$fetcher = new UrlFetcher("https://www.example.com/api/en/articles/create_new/");
if($fetcher->post(["title" => "Sample article", "body" => "Lorem Ipsum..."])){
  echo $fetcher->getContent();
}

Installation

Use the Composer to install the UrlFetcher., (*3)

cd path/to/your/project/
composer require atk14/url-fetcher

Licence

UrlFetcher is free software distributed under the terms of the MIT license, (*4)

The Versions

18/04 2018

dev-master

9999999-dev https://github.com/atk14/Translate

Class providing methods to make http requests

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

url http utils download

03/04 2018

v1.3

1.3.0.0 https://github.com/atk14/Translate

Class providing methods to make http requests

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

url http utils download

31/03 2018

v1.2

1.2.0.0 https://github.com/atk14/Translate

Class providing methods to make http requests

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

url http utils download

04/03 2018

v1.1.1

1.1.1.0 https://github.com/atk14/Translate

Class providing methods to make http requests

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

url http utils download

30/11 2017

v1.1

1.1.0.0 https://github.com/atk14/Translate

Class providing methods to make http requests

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

url http utils download

24/01 2017

v1.0

1.0.0.0 https://github.com/atk14/Translate

A PHP class for converting strings between character maps

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

url http utils download