Ruby RestClient.post 个推接口

starshine · June 10, 2017 · Last by lithium4010 replied at June 11, 2017 · 2112 hits

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" }

Reply to starshine

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

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

You need to Sign in before reply, if you don't have an account, please Sign up first.