未找到 JSON 服务器 PUT 请求

时间:2021-05-06 16:24:06

标签: json rest

我创建了一个 JSON 服务器作为临时后端服务来读取和编辑用户数据。 当我执行这样的读取请求时: http://localhost:3001/users?playerId=1193212 读取请求成功,我得到以下响应:

[
    {
        "playerId": "1193212",
        "partnerId": "506",
        "email": "hhristova+qahriprmpaal16@gan.com",
        "alias": "qahriprmpaal16",
        "forename": "Christine",
        "surname": "Bell",
        "mobileNumber": "9792694595",
        "testAccount": "testAccount",
        "suspended": "accountSuspended"
    }
]

但是,当我执行这样的放置请求时:

PUT

http://localhost:3001/users?playerId=1193212
{
    "playerId" : "1193212",
    "suspended": "accountSuspended"
}

我收到 404 not found 响应。 如何使用 JSON 服务器执行放置请求? 我也试过 http://localhost:3001/users/1193212 我正在发送接受和内容类型标头 = "application/json"

0 个答案:

没有答案