文档
测试

userGroundCollect

POST
api/v1/userGroundCollect

接口描述

用户钓场收藏

请求参数

参数名
类型
描述
必填
ground_id
integer
钓场id
必填
code
integer
0收藏成功1取消收藏
必填

php

$client = new \GuzzleHttp\Client(); $response = $client->post( 'http://sns.shenruxiang.com/api/v1/userGroundCollect', [ 'headers' => [ 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], 'json' => [ 'ground_id' => 6, 'code' => 'rerum', ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body));

js

const url = new URL( "http://sns.shenruxiang.com/api/v1/userGroundCollect" ); let headers = { "Content-Type": "application/json", "Accept": "application/json", }; let body = { "ground_id": 6, "code": "rerum" } 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/userGroundCollect" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{"ground_id":6,"code":"rerum"}'