Download the PHP package tg111/php-request without Composer

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

PHP Request

Latest Version Total Downloads

A Python requests-like HTTP client library for PHP. This library provides an elegant and simple HTTP client with an interface similar to Python's popular requests library.

Documentation

Features

Installation

Install via Composer:

Requirements

Quick Start

Basic Usage

Using Global Functions

Advanced Usage

Custom Headers and Authentication

Cookies

Session Management

Sessions allow you to persist cookies, headers, and other configuration across multiple requests:

Authentication

Error Handling

Response Object

The response object provides various methods to access response data:

Configuration Options

All request methods accept an options array with the following parameters:

Option Type Description
headers array Custom headers to send
cookies array Cookies to include
timeout int Request timeout in seconds
connect_timeout int Connection timeout in seconds
proxy string Proxy URL (http://proxy:port)
proxy_auth string Proxy authentication (user:pass)
verify bool Verify SSL certificates
cert string Path to SSL certificate file
http_version string HTTP version ('1.0', '1.1', '2.0')

Examples

File Upload

API Client Example

Testing

Run the test suite:

Run tests with coverage:

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Comparison with Python requests

Python requests PHP PhpRequest
requests.get(url, params=data) PhpRequest::get($url, $params)
requests.post(url, data=data) PhpRequest::post($url, $data)
requests.Session() PhpRequest::session()
response.text $response->text()
response.json() $response->json()
response.status_code $response->getStatusCode()
response.ok $response->ok()
response.headers $response->getHeaders()

Changelog

See CHANGELOG.md for version history.

Support



All versions of php-request with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ext-curl Version *
ext-json 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 tg111/php-request contains the following files

Loading the files please wait ....