Skip to content

Commit 8189200

Browse files
Added README
1 parent 2d6ff41 commit 8189200

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# WP REST API PSR-7
2+
WP REST API PSR-7 is a small library which creates a bridge between the PSR-7 standards and interfaces and the WordPress REST API Response and Request classes. You can include it via composer in any theme or plugin which needs this.
3+
4+
## More Detail
5+
Development for the WordPress REST API started before the [PSR-7](https://www.php-fig.org/psr/psr-7/) was finalized. This standard made a great way for different libraries to be able to interact using a common interface. Unfortunately, since WordPress missed it, the standard [WP_REST_Request](https://developer.wordpress.org/reference/classes/wp_rest_request/) and [WP_REST_Response](https://developer.wordpress.org/reference/classes/wp_rest_response/) classes are not PSR-7 compliant.
6+
7+
This means that any library which extends HTTP Messages using the PSR-7 standard are not compatible with WordPress by default. Bummer! Our team ran into this limitation when attempting to use the [OAuth2 Server](https://github.com/thephpleague/oauth2-server) library.
8+
9+
## When would I need this?
10+
This is the sort of thing where you don't need it until you do and when you do you'll know it's missing. 🙂

0 commit comments

Comments
 (0)