In WordPress 4.6, the HTTP API will use the open-source independent Requests library instead of the WordPress-specific HTTP library currently used.
“By switching to Requests, a library without any WordPress-specific dependencies, WordPress benefits from input from the wider PHP ecosystem and community,” lead developer of the WordPress REST API Ryan McCue said in the announcement.
Not only does the internal shift make WordPress more inclusive, but it will also benefit from library’s test coverage — which, according to McCue, is at 92 percent of the codebase and growing.
The new library will not interfere with the way WordPress’ HTTP functions are used. In fact, “from your perspective as a developer, nothing should have changed visibly,” McCue said. The new library does, however, introduce new sharing functionality with WP_REST_Response
objects added in WordPress 4.4. This will allow common functionality to be developed for both APIs at the same time.
“In future releases, WordPress may introduce new
WP_HTTP_Request
objects as well, allowing common middleware to be used across both APIs,” McCue said.
WordPress 4.6 is slated for release on August 16, 2016. You can currently test WordPress 4.6 Beta 4 using the WordPress Beta Tester plugin or by downloading the beta directly.
No Comments