Download the PHP package slick/http without Composer

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

Slick HTTP

Latest Version on Packagist Quality Score Total Downloads

slick/http provides a complete implementation of PSR-7 (HTTP Message Interface) and PSR-18 (HTTP Client Interface), enabling developers to work seamlessly with HTTP messages and clients in a standardized way. By adhering to these PSR standards, the library ensures interoperability with other libraries and frameworks that follow the same specifications, promoting code reusability and consistency across projects. In addition, the library includes an HTTP server that functions as a middleware runner, allowing you to pass a collection of middleware objects to the server, which are called in sequence to compose a response for the current server request. This middleware approach provides a flexible, modular way to handle HTTP requests, enhancing the scalability and maintainability of your PHP applications.

This package is compliant with PSR-2 code standards and PSR-4 autoload standards. It also applies the semantic version 2.0.0 specification.

Install

Via Composer

Usage

Server Request Message

This is an handy way to have a HTTP request message that has all necessary information that was sent by the client to the server.

Its very simple to get this:

The $request encapsulates all data as it has arrived at the application from the CGI and/or PHP environment, including:

Consider the following message:

Now lest retrieve its information using the $request object:

HTTP Server

The HTTP server is a middleware runner. You can pass a collection of middleware objects to the server and they all will be called in their sequence in order to compose a response for current server request.

Lets create a simple web application that will print out a greeting to a query parameter named 'name'. Lets first create our middleware classes:

This middleware retrieves the query parameter with name and add an attribute to the request object passed to the next middleware in the stack. Lets create our printer:

Now lets create our main server application:

HTTP Client

Working with HTTP requests (as a client) is one of the most common tasks nowadays. Almost every application need to retrieve data from a web service or API and therefore an HTTP client is a must have.

Slick\Http\Client\CurlHttpClient implments PSR-18 HTTP Client

It depends on PHP's cURL extension to connect and make HTTP requests. Lets see an example:

Session

Slick\Http\Session has a very simple and ease implementation. By default it will use the PHP session handling and it comes with a simple factory that you can use to create it:

Write session data
Read session data
Deleting session data

You can create your own session drivers if you need to encrypt you data or change the save handler to save in a database by simply implementing the Slick\Http\Session\SessionDriverInterface. It also comes with a Slick\Http\Session\Driver\AbstractDriver class that has all the basic operations of the interface already implemented.

Please check documentation site for a complete reference.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

Contributing

Please see CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of http with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-curl Version *
psr/http-client Version ^1.0@dev
psr/http-message Version ^1.0
psr/http-server-middleware 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 slick/http contains the following files

Loading the files please wait ....