gonzalo123/angularpostrequestserviceprovider
Composer 安装命令:
composer require gonzalo123/angularpostrequestserviceprovider
包简介
Angular POST Request Service Provider
README 文档
README
When we work with AngularJs Applications POST request uses Content-Type: application/json Silex (and Symfony) assumes application/x-www-form-urlencoded Here we can se how to handle those requests with Silex: https://github.com/qandidate-labs/symfony-json-request-transformer
In this small project we are going to enclose this funcionality within a ServiceProvider
Install Via Composer
{
"require": {
"gonzalo123/angularpostrequestserviceprovider": "~1.0"
}
}
Usage
use Silex\Application; use G\AngularPostRequestServiceProvider; use Symfony\Component\HttpFoundation\Request; $app = new Application(); $app->register(new AngularPostRequestServiceProvider()); $app->post("/post", function (Application $app, Request $request) { return $app->json([ 'status' => true, 'name' => $request->get('name') ]); }); $app->run();
统计信息
- 总下载量: 101
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-20