Download the PHP package masterklavi/phprequest without Composer

On this page you can find all versions of the php package masterklavi/phprequest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phprequest

PHP Request

It includes some functions to easy requesting and parsing data.

Examples

Requirements

Installation

Using Composer

Get the package:

Include vendor/autoload.php:

Manual Installation

Clone git repository:

or download the package at https://github.com/masterklavi/phprequest/archive/master.zip

Include autoload.php:

Methods

Request::request

Requests the given URL.

Syntax

Parameters

$url – URL address
$options – Array of request options

Return Values

Returns a response (body) as string by default. Returns a mixed value when the filter option's set. Returns false on failure.

Request::get

Alias of Request::request()

Request::post

Equivalent of

Request::multi

Requests the given URLs (parallel requests using curl multi).

Syntax

Parameters

$url – Array of URL address strings or arrays of URL addresses and their options (e.g. [ 'http://a.ru', ['http://b.ru', ['filter' => 'json']] ])
$options – Array of request options

Return Values

Returns an array of results for the given urls. Result may contain:

Request::multiGet

Alias of Request::multi()

Request::multiPost

Equivalent of

Request Options

List of curl options:

Name Type Default Description
method string GET The method of the HTTP request (GET, POST, HEAD, PUT, DELETE) (see CURLOPT_POST, CURLOPT_CUSTOMREQUEST)
data string, array Querystring for GET, HEAD and DELETE requests, or request body for others (see CURLOPT_POSTFIELDS)
follow boolean false Follow HTTP redirections (see CURLOPT_FOLLOWLOCATION)
encoding string The contents of the "Accept-Encoding: " header (see CURLOPT_ENCODING)
timeout integer 300 The timeout of one request (see CURLOPT_TIMEOUT)
session string Path to cookie-based session file (enables session between different calls) (see CURLOPT_COOKIEJAR)
cookie string The contents of the "Cookie: " header (see CURLOPT_COOKIE)
headers array An array of HTTP headers (see CURLOPT_HTTPHEADER)
referer string The contents of the "Referer: " header (see CURLOPT_REFERER)
useragent string The contents of the "User-Agent: " header (see CURLOPT_USERAGENT)
proxy string Proxy string like IP:PORT or username:password@IP:PORT (see CURLOPT_PROXY, CURLOPT_PROXYUSERPWD)
interface string Used interface (IP or host) (see CURLOPT_INTERFACE)
curl array An array of custom curl options

List of special options:

Name Type Default Description
allowed_codes array [200] Allowed HTTP codes
allow_empty boolean false Allows empty body of the HTTP response
filter string, callable Filters body (usually to reduce memory usage). See Available filters
charset string The charset of requested content (the result will contain 'utf8')
attempts integer 5 Number of request attempts
concurrency integer 10 Concurrency of requests in Request::multi()

Filters

Plain filters:

Complex filters:


All versions of phprequest with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
ext-curl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package masterklavi/phprequest contains the following files

Loading the files please wait ....