文档
测试

userInfoEdit

POST
api/v1/userInfoEdit

接口描述

用户信息更新

请求参数

参数名
类型
描述
必填
nick
string
用户昵称
必填
city
string
城市
必填
desc
string
描述
必填
phone
string
手机号
必填
avatar
string
头像
必填
background
string
北京
必填
address
string
具体地址
必填

php

$client = new \GuzzleHttp\Client(); $response = $client->post( 'http://sns.shenruxiang.com/api/v1/userInfoEdit', [ 'headers' => [ 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], 'json' => [ 'nick' => 'qui', 'city' => 'qui', 'desc' => 'quo', 'phone' => 'voluptatum', 'avatar' => 'eveniet', 'background' => 'sit', 'address' => 'ipsa', ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body));

js

const url = new URL( "http://sns.shenruxiang.com/api/v1/userInfoEdit" ); let headers = { "Content-Type": "application/json", "Accept": "application/json", }; let body = { "nick": "qui", "city": "qui", "desc": "quo", "phone": "voluptatum", "avatar": "eveniet", "background": "sit", "address": "ipsa" } fetch(url, { method: "POST", headers: headers, body: body }) .then(response => response.json()) .then(json => console.log(json));

返回值

{ "code": 0, "msg": "编辑资料成功", "data": [] }

bash

curl -X POST \ "http://sns.shenruxiang.com/api/v1/userInfoEdit" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{"nick":"qui","city":"qui","desc":"quo","phone":"voluptatum","avatar":"eveniet","background":"sit","address":"ipsa"}'