[关闭]
@fuyb1986 2016-03-30T07:34:58.000000Z 字数 1204 阅读 606

更新用户详细地址

好热闹


Method and URL Structure

Method Resource URL
POST /forum/user_update/

Request Parameters

Name Description Required Default
username 用户名 YES
password 密码 YES
optname 要更新的数据选项 YES
value [^value] 要更新的值 YES

Optname List

Name Description
info 修改基本信息: 昵称、头像、简介
nickname 昵称
desc 简介
thumb 头像
deliver_addess 收货地址
name 收货人姓名
telphone 电话

Deliver Adress Parameters

Request

  1. {
  2. "username":"username",
  3. "password":"password",
  4. "optname":"deliver_addess",
  5. "value":data,
  6. }

cURL Example

  1. # 更新收获取地址
  2. $ curl -H "Accept: application/json" -H "Content-Type: application/json" -X POST \
  3. --data '{
  4. "username":"18012345678",
  5. "password":"123456",
  6. "optname":"deliver_address",
  7. "value": {
  8. "provincial":"上海",
  9. "city":"上海",
  10. "area":"浦东",
  11. "town":"张江",
  12. "address_detail":"我的收货地址",
  13. "postcode":"12345"
  14. }
  15. }' \
  16. 'http://www.haorenao.cn/froum/user_update/'
  17. # 更新基本信息
  18. $ curl -H "Accept: application/json" -H "Content-Type: application/json" -X POST \
  19. --data '{
  20. "username":"18012345678",
  21. "password":"123456",
  22. "optname":"info",
  23. "value":{
  24. "nickename":"erxiao",
  25. "desc":"nanana",
  26. "thumb":""
  27. }
  28. }' \
  29. http://www.haorenao.cn/forum/user_update/
  30. # 更新昵称
  31. $ curl -d '{"username":"18016271364", "password=123456", "optname":"nickname", "value":"xiaoer"}' http://www.haorenao.cn/forum/user_upate

JSON Response

Name Description
ret 标识是否成功。ok, 成功; failed, 失败
reason 失败原因
  1. {
  2. "ret":"ok",
  3. "reason":"",
  4. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注