Download the PHP package rsong/phprequest without Composer

On this page you can find all versions of the php package rsong/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

Statement

It's a copy of https://github.com/ptcong/easyrequest

EasyRequest

A light weight PHP http client implements PSR7, use socket/curl for sending requests.

Features

Requirements

Installation

Sometimes you don't want to use composer, just want to include only one file as way our old library does (ptcong/php-http-client). Let run build/run.php script to get compiled.php file and include it at the top of your script.

Usage

Create a request

Client::request method just create a new instance of \EasyRequest\Client class.

with default options

Set request options

withOption method will overide to existing option. If you want to append query string, form params to current option, read it under.

Quick request

This methods will create new request and send immediately, you don't need to call send() method here.

Add header to request

Working with cookies

You can use header option to add cookie as above, but we already have CookieJar to handle cookie for you. By deaults, Client class will automatic create an CookieJar instance before sending request if cookie_jar is not set. You can choose:

Get response cookies

You can use $jar->getFor($domain, $path) method to get cookies for specific domain and path. This method will create new CookieJar instance contains your cookies

Add query string

or you can use withQuery method, it's dynamic method and can handle some cases

Add form params

This is similar with Add query string

and you can use withFormParam method same as withQuery

Add multipart data

Each multipart part requires name, contents

Upload file

You can use multipart option to upload file, but use this method is more easier.

Post RAW data

Post JSON data

Used to easily upload JSON encoded data as the body of a request. A Content-Type: application/json header will be added if no Content-Type header is already present on the message.

Working with proxy

You may use a HTTP or SOCKS4, SOCKS4A, SOCKS5 Proxy.

Auth basic

Bind request to interface

Get Response

When working with follow redirects option, sometimes you may want to get current url (last redirected url).

This getCurrentUri method will returns \Psr\Http\Message\UriInterface

Get redirected requests

When use follow_redirects option, sometimes you want to get all the requests and responses.

Each request and response are following PSR7

Get responses

Get debug info

When a request is fail, you can use $request->getError() to see error message.

and use $request->getDebug() to see some debug information.


All versions of phprequest with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
psr/http-message Version ^1.0
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 rsong/phprequest contains the following files

Loading the files please wait ....