> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PUT (/json/users/xuid({xuid})/scids/{scid}/data/{pathAndFileName},json)

> PUT (/json/users/xuid({xuid})/scids/{scid}/data/{pathAndFileName},json)

# PUT (/json/users/xuid({xuid})/scids/{scid}/data/{pathAndFileName},json)

上传文件。json 类型的数据不支持多块上传。
这些 URI 的域为 `titlestorage.xboxlive.com`。

* [URI 参数](#ID4EX)
* [授权](#ID4EEB)
* [可选查询字符串参数](#ID4ERB)
* [必需的请求头](#ID4EXC)
* [可选请求头](#ID4EAE)
* [请求正文](#ID4EDF)
* [HTTP 状态代码](#ID4EOF)
* [响应正文](#ID4EBDAC)

## URI 参数

| 参数 | 类型 | 说明 |
| - | - | - |
| xuid | 无符号 64 位整数 | 发出请求的玩家的 XBOX 用户 ID (XUID)。 |
| scid | guid | 要查找的服务配置的 ID。 |
| pathAndFileName | string | 要访问项的路径和文件名。路径部分（直到并包括最终的正斜杠）的有效字符包括大写字母 (A-Z)、小写字母 (a-z)、数字 (0-9)、下划线 (*) 和正斜杠 (/)。路径部分可以为空。文件名部分（最终正斜杠之后的所有内容）的有效字符包括大写字母 (A-Z)、小写字母 (a-z)、数字 (0-9)、下划线 (*)、句点 (.) 和连字符 (-)。文件名不能为空、以句点结尾或包含两个连续的句点。 |

## 授权

请求必须包含有效的 XBOX LIVE 授权头。如果不允许调用方访问此资源，则服务将返回 403 Forbidden 响应。如果头无效或缺失，则服务将返回 401 Unauthorized 响应。

## 可选查询字符串参数

\| 参数| 类型| 说明|
\| --- | --- | --- | --- | --- | --- |
\| clientFileTime| DateTime| 最后上传该文件的任何客户端上文件的日期/时间。|
\| displayName| string| 应显示给用户的文件名。|

## 必需的请求头

\| 头| 值| 说明|
\| --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| x-xbl-contract-version| 1| API 协定版本。|
\| Authorization| XBL3.0 x=\[hash];\[token]| STS 身份验证令牌。STSTokenString 由身份验证请求返回的令牌替换。有关检索 STS 令牌和创建授权头的详细信息，请参阅 “对 XBOX LIVE 服务请求进行身份验证和授权”。|

## 可选请求头

\| 头| 说明|
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| If-Match| 指定必须与现有项匹配才能完成操作的 ETag。|
\| If-None-Match| 指定不得与任何现有项匹配才能完成操作的 ETag。|

## 请求正文

请求正文包含要上传的文件的完整内容。

## HTTP 状态代码

服务将返回本节中的其中一个状态代码，以响应针对此资源使用此方法发出的请求。有关 XBOX Live 服务使用的标准 HTTP 状态代码的完整列表，请参阅 [标准 HTTP 状态代码](https://devdocs.xbox.com/zh-CN/reference/live/rest/additional/httpstatuscodes)。

\| 代码| 原因短语| 说明|
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| 200| OK | 请求成功。|
\| 201| Created | 已创建实体。|
\| 400| Bad Request | 服务无法理解格式错误的请求。通常是参数无效。|
\| 401| Unauthorized | 请求需要用户身份验证。|
\| 403| Forbidden | 不允许用户或服务发出此请求。|
\| 404| Not Found | 未找到指定的资源。|
\| 406| Not Acceptable | 资源版本不受支持。|
\| 408| Request Timeout | 请求耗时过长无法完成。|
\| 500| Internal Server Error | 服务器遇到意外情况，无法完成请求。|
\| 503| Service Unavailable | 请求已被限流，请在客户端重试值（以秒为单位，例如 5 秒后）之后重试请求。|

## 响应正文

如果上传成功，将返回 201 及 { } 响应。

## 另请参阅

##### 上级

[/json/users/xuid({xuid})/scids/{scid}/data/{pathAndFileName},json](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/storage/uri-jsonusersxuidscidssciddatapathandfilenametype)


## Related topics

- [XblTitleStorageUploadBlobAsync](https://devdocs.xbox.com/es/reference/live/xsapi-c/title_storage_c/functions/xbltitlestorageuploadblobasync.md)
- [XblTitleStorageDeleteBlobAsync](https://devdocs.xbox.com/es/reference/live/xsapi-c/title_storage_c/functions/xbltitlestoragedeleteblobasync.md)
