Ruby RestClient.post 个推接口

starshine · 2017年06月10日 · 最后由 lithium4010 回复于 2017年06月11日 · 2110 次阅读

ruby 大神帮忙看看:: RestClient.post 个推接口

RestClient.post "https://restapi.getui.com/v1/VHkkkkk975Rt/push_single", getui_msg, {"authtoken"=>"1221121212","Content-Type"=>"application/json"}

总是返回 { "result": "not_auth" }

先排版代码,结果提示不是很清楚么,你没有登陆,没权限。

用 postMan 就可以成功,一样的参数,RestClient.post 就每次返回 { "result": "not_auth" }

starshine 回复

账号密码需要吧,贴一个更完整的代码看吧。

getui_msg 这个你传的是 Hash 还是 String?应该要传 String

需要 登录 后方可回复, 如果你还没有账号请 注册新账号