文档
测试

sendComment

POST
api/v1/sendComment

接口描述

发送钓场评论/回复评论

请求参数

参数名
类型
描述
必填
user_id
integer
用户id
必填
token
integer
用户token
必填
ground_id
integer
钓场id
必填
comment_id
integer
帖子评论id 第一次评论传空 评论回复传评论id
必填
comment_content
string
帖子评论内容
必填
to_user_id
integer
对方用户id
必填

php

$client = new \GuzzleHttp\Client(); $response = $client->post( 'http://sns.shenruxiang.com/api/v1/sendComment', [ 'headers' => [ 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], 'json' => [ 'user_id' => 20, 'token' => 10, 'ground_id' => 10, 'comment_id' => 4, 'comment_content' => 'assumenda', 'to_user_id' => 4, ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body));

js

const url = new URL( "http://sns.shenruxiang.com/api/v1/sendComment" ); let headers = { "Content-Type": "application/json", "Accept": "application/json", }; let body = { "user_id": 20, "token": 10, "ground_id": 10, "comment_id": 4, "comment_content": "assumenda", "to_user_id": 4 } 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/sendComment" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{"user_id":20,"token":10,"ground_id":10,"comment_id":4,"comment_content":"assumenda","to_user_id":4}'