Skip to content

Latest commit

 

History

History
71 lines (54 loc) · 1.32 KB

Attack_CN.md

File metadata and controls

71 lines (54 loc) · 1.32 KB

攻击单元

URL

http://106.75.33.221:6000/api/cell/

Method

PUT

Header

Content-Type: application/json

Body

{
	"Game": "382bb353448f4c4d9637263518c085b9",
	"Player": "48d19c8b4419409a9a63dfd1c8152db2",
	"X": 2,
	"Y": 4
}

Game: 欲攻击单元的所属游戏Id

Player: 玩家自己的PlayerId

X: 欲攻击单元的x坐标

Y: 欲攻击单元的y坐标

返回结果

成功 Status Code: 200

失败 Status Code: 404

示例

Python

import requests

url = "http://106.75.33.221:6000/api/cell/"

payload = "{\"Game\":\"382bb353448f4c4d9637263518c085b9\", \"Player\":\"48d19c8b4419409a9a63dfd1c8152db2\", \"X\":2, \"Y\":4}"
headers = {
    'Content-Type': "application/json",
    'Cache-Control': "no-cache"
    }

response = requests.request("PUT", url, data=payload, headers=headers)

print(response.text)

JavaScript

var settings = {
  "async": true,
  "crossDomain": true,
  "url": "http://106.75.33.221:6000/api/cell/",
  "method": "PUT",
  "headers": {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache"
  },
  "processData": false,
  "data": "{\"Game\":\"382bb353448f4c4d9637263518c085b9\", \"Player\":\"48d19c8b4419409a9a63dfd1c8152db2\", \"X\":2, \"Y\":4}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});