node-webot / co-wechat-api

Wechat API. Support Async Functions
Other
723 stars 170 forks source link

似乎所有 POST 请求都有 Bug? #32

Closed mouhong closed 8 years ago

mouhong commented 8 years ago

co-wechat-api 版本: 2.4.2 httpx 版本: 2.0.0

我使用uploadMedia时一直都是提示"missing media data hint",看了下 co-wechat-api 的代码,似乎所有的 POST API 都可能有问题?

先看 lib/api_media.js https://github.com/node-webot/co-wechat-api/blob/master/lib/api_media.js#L32

它给 this.request 传的 opts 中 http method 是用 type 来指定的。 在 api_common.js 中,它原样传给 httpx。

再看 httpx 的 index.js: https://github.com/JacksonTian/httpx/blob/master/index.js#L29

它接受的是method属性名,而不是type

这个是 bug ?

Thanks

JacksonTian commented 8 years ago

代码迁移的问题。type是urllib用的。欢迎PR。

JacksonTian commented 8 years ago

已经修复了