2017 © Pedro Peláez
 

library wp-http

The Missing WordPress HTTP Foundation

image

awethemes/wp-http

The Missing WordPress HTTP Foundation

  • Thursday, July 19, 2018
  • by awethemes
  • Repository
  • 2 Watchers
  • 5 Stars
  • 803 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 11 Versions
  • 121 % Grown

The README.md

WP-HTTP Build Status

Provide HTTP Request & Response for WordPress inspired by Laravel., (*1)

Examples

<?php

use Awethemes\Http\Kernel;
use Awethemes\Http\Request;

function my_plugin_register_routes( $router ) {
    $router->get( '/hello/{user}', function( Request $request, $user ) {
        return [ 'hello' => $user ];
    });
}

function my_plugin_dispatch() {
    global $wp;

    if ( empty( $wp->query_vars['my-route'] ) ) {
        return;
    }

    $kernel = new Kernel;
        ->use_request_uri( $wp->query_vars['my-route'] )
        ->use_dispatcher( \FastRoute\simpleDispatcher( 'my_plugin_register_routes' ) )
        ->handle( Request::capture() );
}
add_action( 'parse_request', 'my_plugin_dispatch' );

Test your route:, (*2)

> curl -X GET "http://yoursite.dev/index.php?my-route=/hello/david"

{"hello":"david"}

The Versions

19/07 2018

dev-master

9999999-dev

The Missing WordPress HTTP Foundation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nguyen Van Anh
by Avatar awethemes

19/07 2018

v1.1.1

1.1.1.0

The Missing WordPress HTTP Foundation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nguyen Van Anh
by Avatar awethemes

19/06 2018

v1.1.0

1.1.0.0

The Missing WordPress HTTP Foundation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nguyen Van Anh
by Avatar awethemes

15/06 2018

v1.0.4

1.0.4.0

The Missing WordPress HTTP Foundation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nguyen Van Anh
by Avatar awethemes

25/04 2018

v1.0.3

1.0.3.0

The Missing WordPress HTTP Foundation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nguyen Van Anh
by Avatar awethemes

05/04 2018

v1.0.2

1.0.2.0

The Missing WordPress HTTP Foundation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nguyen Van Anh
by Avatar awethemes

08/01 2018

v1.0.1

1.0.1.0

The Missing WordPress HTTP Foundation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nguyen Van Anh
by Avatar awethemes

08/01 2018

1.0.0

1.0.0.0

The Missing WordPress HTTP Foundation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nguyen Van Anh
by Avatar awethemes

07/12 2017

0.3.0

0.3.0.0

The Missing WordPress HTTP Foundation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nguyen Van Anh
by Avatar awethemes

16/11 2017

0.2.0

0.2.0.0

The Missing WordPress HTTP Foundation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nguyen Van Anh
by Avatar awethemes

16/11 2017

0.1.0

0.1.0.0

The Missing WordPress HTTP Foundation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nguyen Van Anh
by Avatar awethemes