Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 15, 2024 via composer

symfony/http-client-contracts v1.1.5

Generic abstractions related to HTTP clients
Package summary
Share
0
issues
1
license
1
MIT
Package created
27 May 2019
Version published
17 Jun 2019
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
symfony/http-client-contracts@v1.1.5
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of symfony/http-client-contracts 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does symfony/http-client-contracts do?

The Symfony HttpClient Contracts package provides a set of abstract protocols related to HTTP clients. These abstractions have been delicately carved out from the Symfony components, making use of battle-tested implementations proven to be effective and useful. This package aids in making your HTTP client management more efficient and streamlined.

How do you use symfony/http-client-contracts?

To use Symfony HttpClient Contracts, you'll need to include the package in your project using Composer first. This can be done using the command composer require symfony/http-client-contracts.

Once the package is included in your PHP project, you can use the HTTP client contracts by calling the relevant methods provided by this package. Here's a basic implementation to fetch a web page content for instance:

use Symfony\Contracts\HttpClient\HttpClientInterface;

class YourClass
{
    private $client;

    public function __construct(HttpClientInterface $client)
    {
        $this->client = $client;
    }

    public function fetchContent(string $url): string
    {
        $response = $this->client->request('GET', $url);

        // returns the HTTP body and throws a TransportExceptionInterface if an error happened during the request
        return $response->getContent();
    }
}

This shows how to use dependency injection to inject the HttpClientInterface into your class and use it to make a request.

Where are the symfony/http-client-contracts docs?

Documentation for the Symfony HttpClient Contracts package can be found in the main README file on the package's GitHub repository. This README file provides all the necessary details needed to understand and use the features provided by the HttpClient Contracts package. The repository URL for the documentation is: Symfony HttpClient Contracts README