co-wechat-body
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -13,3 +13,3 @@ 'use strict'; | ||
} | ||
} | ||
}; | ||
@@ -19,3 +19,3 @@ function* formater(next) { | ||
if(this.request.body && this.request.body.xml){ | ||
this.request.body = formatMessage(this.request.body); | ||
this.request.body = formatMessage(this.request.body.xml); | ||
} | ||
@@ -50,2 +50,2 @@ | ||
return message; | ||
}; | ||
} |
{ | ||
"name": "co-wechat-body", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Wechat xml mesage body parser for koa.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -38,3 +38,23 @@ # co-wechat-body | ||
## Example | ||
http request raw body: | ||
``` | ||
<xml> | ||
<return_code><![CDATA[SUCCESS]]></return_code> | ||
<return_msg><![CDATA[OK]]></return_msg> | ||
</xml> | ||
``` | ||
parse result, this.request.body: | ||
``` | ||
{ | ||
"return_code": "SUCCESS", | ||
"return_msg": "OK" | ||
} | ||
``` | ||
## Options | ||
@@ -41,0 +61,0 @@ |
5386
82