php
$client = new \GuzzleHttp\Client();
$response = $client->post(
'http://sns.shenruxiang.com/api/v1/groundPondDetail',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'pond_id' => 15,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
js
const url = new URL(
"http://sns.shenruxiang.com/api/v1/groundPondDetail"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"pond_id": 15
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
返回值
{
"code": 0,
"msg": "请求成功",
"data": {
"id": "19【鱼塘id】",
"src": "http:\/\/daodao.shenruxiang.com\/0b11e1ea0ba5edf41d80a06f96dc980c.jpg【鱼塘图片】",
"price": "100.00【鱼塘价格】",
"type": "1【鱼塘类别 1冷塘 2温塘 3热塘】",
"seat_type": "1【选座方式1随机派发钓位号2自主选钓位号】",
"water_depth": "100【水深】",
"people_num": "66【活动人数】",
"desc": "鱼塘描述【活动描述】",
"origin_pond_id": 19,
"ground_id": "2【钓场id】",
"pond_fish": [
{
"pond_id": "19【鱼塘id】",
"name": "鲤鱼【鱼名】",
"price": "15.00【价格】",
"weight": "100【鱼重量斤】"
},
{
"pond_id": "19【鱼塘id】",
"name": "鲤鱼【鱼名】",
"price": "15.00【价格】",
"weight": "100【鱼重量斤】"
}
],
"fish_buy_list": {
"1": {
"id": "1【钓位号】",
"yest": "100【昨天出鱼量】",
"week": "100【周出鱼量】",
"all": "100【全部出鱼量】"
}
},
"start_pond": {
"start_time": "2020-09-13 10:00:00【活动开始时间】",
"end_time": "2020-09-13 10:00:00【活动结束时间】",
"id": 18
},
"ground": {
"name": "接口测试钓场【钓场名称】"
}
}
}
bash
curl -X POST \
"http://sns.shenruxiang.com/api/v1/groundPondDetail" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"pond_id":15}'