10 个最好的 PHP 库用于轻松发送HTTP请求

jopen 8年前

1. PHP VCR

With PHP VCR, you can record your test suite’s HTTP communications and replay them all through forthcoming test runs for quick, comparative and precise tests. It automatically records and replays HTTP(s) collaborations with nominal setup and make no revisions to your essential production code. Recorded requests and responses can effortlessly be examined and corrected.

10 个最好的 PHP 库用于轻松发送HTTP请求

2. Guzzle

Guzzle takes the pain out of sending HTTP requests and the redundancy out of creating web service clients. It is a framework that comprises tools required for developing a strong web service client, containing: Resource iterators for traversing paginated resources, Service reports for outlining the inputs & outputs of an API, batching for transporting a big amount of requests as proficiently as possible.

10 个最好的 PHP 库用于轻松发送HTTP请求

3. Buzz react

Simple async HTTP client for synchronously cooperating with numerous HTTP servers, downloading files, fetching URLs, following redirects, talking to RESTful APIs etc. all at the same time.

10 个最好的 PHP 库用于轻松发送HTTP请求

4. Httpful

Httpful is a meek and legible PHP library envisioned to make speaking HTTP well-balanced. It allows the developer to concentrate on intermingling with APIs instead of selecting through curl set_opt pages and is a perfect PHP REST client which comes with some useful features like request templates, basic auth, custom headers, client side certificate auth, automatic payload serialization & more.

10 个最好的 PHP 库用于轻松发送HTTP请求

5. Requests

Requests is a steady PHP library that make use of fsockopen or cURL (depending on the accessibility) and offers a reliable API. It lets you send HEAD, DELETE, UPDATE, POST GET, PUT, and PATCH HTTP requests. Multipart files, parameters, form data and Headers with simple arrays can be added easily, and access the response data in an identical manner.

10 个最好的 PHP 库用于轻松发送HTTP请求

6. Simple Http Client

This is a fairly handy PHP library which is used to make simple HTTP requests from PHP and is accessible as open source software under the MIT License.

10 个最好的 PHP 库用于轻松发送HTTP请求

7. httpClient

PHP Http Client is HTTP client that has been created purely in PHP only (100% PHP) and does not make use of cURL or any other external libraries.

10 个最好的 PHP 库用于轻松发送HTTP请求

8. Goutte

Goutte is a web crawling library for PHP which can also be used for screen scraping. It comes with a nice API to crawl & fetch data from HTML responses

10 个最好的 PHP 库用于轻松发送HTTP请求

9. Unirest

Unirest is a package of frivolous HTTP libraries for numerous languages (Java, Python, PHP, Ruby and Objective-C) and supports DELETE, UPDATE, POST GET, PUT operations. Methods and response structure of Unirest is similar in all languages.

10 个最好的 PHP 库用于轻松发送HTTP请求

10. Buzz

Buzz is a lightweight HTTP client that can be used to save and restore data, which is well-suited for the novices to learn more about the working of HTTP clients in a simple way

10 个最好的 PHP 库用于轻松发送HTTP请求