存储用于发出请求的信息。一般来说,不需要直接构建。 Stores information for making a request. In general this does not need to be constructed directly.
| 名称 Name | 类型 Type | 说明 Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
可选 optional
具有以下属性的对象: An object with the following properties:
|
成员 Members
cancelFunction : Request.CancelCallback
取消请求时调用的函数。 The function that is called when the request is cancelled.
优先级是无单位的值,其中较低的值表示较高的优先级。对于基于世界的对象,这通常是距相机的距离。没有优先级函数的请求默认优先级为 0。如果定义了priorityFunction,则该值每帧都会使用该调用的结果更新。 Priority is a unit-less value where lower values represent higher priority. For world-based objects, this is usually the distance from the camera. A request that does not have a priority function defaults to a priority of 0. If priorityFunction is defined, this value is updated every frame with the result of that call.
-
默认值: Default Value:
0.0
priorityFunction : Request.PriorityCallback
调用该函数来更新请求的优先级,每帧发生一次。 The function that is called to update the request's priority, which occurs once per frame.
requestFunction : Request.RequestCallback
发出实际数据请求的函数。 The function that makes the actual data request.
readonly state : RequestState
请求的当前状态。 The current state of the request.
是否限制请求并确定请求的优先级。如果错误,请求将立即发送。如果为 true,则请求将受到限制并根据优先级发送。 Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority.
-
默认值: Default Value:
false
是否通过服务器限制请求。浏览器通常支持大约 6-8 个 HTTP/1 服务器并行连接,以及 HTTP/2 服务器无限数量的连接。将此值设置为 Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value to
true 对于通过 HTTP/1 服务器的请求来说更可取。 is preferable for requests going through HTTP/1 servers.
-
默认值: Default Value:
false
readonly type : RequestType
请求类型。 Type of request.
-
默认值: Default Value:
RequestType.OTHER
要请求的 URL。 The URL to request.
方法 Methods
clone(result) → Request
Duplicates a Request instance.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
result |
Request | 可选 optional 用于存储结果的对象。 The object onto which to store the result. |
返回: Returns:
修改后的结果参数或新的资源实例(如果未提供)。 The modified result parameter or a new Resource instance if one was not provided.
类型定义 Type Definitions
取消请求时调用的函数。 The function that is called when the request is cancelled.
调用该函数来更新请求的优先级,每帧发生一次。 The function that is called to update the request's priority, which occurs once per frame.
返回: Returns:
更新后的优先级值。 The updated priority value.
发出实际数据请求的函数。 The function that makes the actual data request.
返回: Returns:
对所请求数据的承诺。 A promise for the requested data.
