Closed mouhong closed 8 years ago
co-wechat-api 版本: 2.4.2 httpx 版本: 2.0.0
我使用uploadMedia时一直都是提示"missing media data hint",看了下 co-wechat-api 的代码,似乎所有的 POST API 都可能有问题?
uploadMedia
先看 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。
type
再看 httpx 的 index.js: https://github.com/JacksonTian/httpx/blob/master/index.js#L29
它接受的是method属性名,而不是type。
method
这个是 bug ?
Thanks
代码迁移的问题。type是urllib用的。欢迎PR。
已经修复了
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