Download the PHP package p3k/http without Composer

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

p3k-http

A simple HTTP client, used by https://p3k.io projects.

Usage

GET

POST

HEAD

Response

The get/post/head functions will return an array with the following properties:

headers

The headers key will be an array of all the header values returned. The values will be either a string or array depending on whether there were multiple values returned for a given header name.

rels

The rels key will be the parsed version of any HTTP Link headers that contain a rel value. All values will be arrays even if there is only one value.

Options

There are a few options you can set when making HTTP requests, to configure how the request will behave.

User Agent

You can set the user agent when you first instantiate the HTTP object:

Alternately, you can change it before each request:

Transports

By default, the library will use the PHP curl functions to make the HTTP request.

You can optionally define your own transport to use to make HTTP requests instead. This allows you to use an existing HTTP request mechanism you may have rather than using curl or the PHP stream functions.

Define a new class that implements the p3k\HTTP\Transport interface. That interface documents the return values expected as well.

Then you can set the transport after you create the main HTTP object.

The library ships with two alternative transport mechanisms, p3k\HTTP\Stream and p3k\HTTP\Test. The Stream transport uses file_get_contents with all the necessary config options to make it work. This is useful when running in Google App Engine. The Test transport will read HTTP responses from files, so that you can write tests that simulate making HTTP calls. See https://github.com/aaronpk/XRay/tree/master/tests for an example of using this transport.

License

Copyright 2017 by Aaron Parecki

Available under the MIT license.


All versions of http with dependencies

PHP Build Version
Package Version
Requires indieweb/link-rel-parser Version 0.1.*
mf2/mf2 Version >=0.3.2
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 p3k/http contains the following files

Loading the files please wait ....