# 标准表单 Post with x-www-form-urlencoded
see `public/post.html`
```
<script>
$(function(){
$.ajaxSetup({
contentType: "application/x-www-form-urlencoded; charset=utf-8"
});
$.post("/users/post", { name: "i5a6", time: "2pm" },
function(data){
console.log(data);
}, "json");
});
</script>
```
in `routes/users.js`
```
router.post('/post', function(req, res) {
// res.send('respond with a resource');
res.json(req.body);
});
```
测试
```shell
$ npm test
```
使用Postman测试
![](img/post-common.png)
- Introduction
- Nodejs 4.x新特性
- classes
- typed arrays
- generators
- collections
- Set
- Map
- arrow functions
- block scoping
- template strings
- promises
- symbols
- Koa基础
- 上下文
- koa-generator
- 安装
- 创建项目
- 更改视图模板引擎
- Routes
- HTTP
- Get
- 如何获取query参数
- 如何获取params
- Post
- 从post获取参数
- 标准表单(Post with x-www-form-urlencoded)
- 文件上传(Post with form-data)
- Post with raw
- 数据库
- MySQL
- Mongo
- 流程控制
- generator/co
- es6的generator是什么?
- co = generator + promise
- async/await
- promise with bluebird
- 测试
- Mocha
- Supertest
- 部署
- 最佳实践
- FAQ
- 如何发布本书到git pages
- 如何知道require模块的用法
- koa中的异常处理