AssetCreateRequest

class AssetCreateRequest(resource: Resource, name: String? = resource.name, resourceContentType: ContentType? = null) : KookPostRequest<AssetCreated>

上传媒体文件.

创建(上传)文件资源,例如图片等。

Author

ForteScarlet

Parameters

resource

资源对象。

name

需要能够体现出文件的扩展名(例如 mov, jpg),否则尽可能提供 resourceContentType 参数。

resourceContentType

资源的content类型。

Constructors

Link copied to clipboard
fun AssetCreateRequest(resource: Resource, name: String? = resource.name, resourceContentType: ContentType? = null)

Types

Link copied to clipboard

Functions

Link copied to clipboard
open suspend fun request(client: HttpClient, authorization: String, decoder: Json = DEFAULT_JSON, postChecker: suspend (HttpResponse) -> Unit = {}): ApiResult

通过 client 执行网络请求并尝试得到结果。

Link copied to clipboard
open fun requestBlocking(client: HttpClient, authorization: String, decoder: Json = DEFAULT_JSON, postChecker: Consumer<HttpResponse> = defaultRequestPostChecker): ApiResult

通过 client 执行网络请求并尝试得到结果。

Link copied to clipboard
open suspend fun requestData(client: HttpClient, authorization: String, decoder: Json = DEFAULT_JSON): AssetCreated

通过 client 执行网络请求并尝试得到结果。

Link copied to clipboard
open fun requestDataBlocking(client: HttpClient, authorization: String, decoder: Json = DEFAULT_JSON): AssetCreated

通过 client 执行网络请求并尝试得到结果。

Properties

Link copied to clipboard
open val body: Any?

可以提供一个body实例。

Link copied to clipboard
open override val method: HttpMethod

此请求的 method.

Link copied to clipboard
open override val resultDeserializer: DeserializationStrategy<out AssetCreated>

得到响应值的反序列化器.

Link copied to clipboard
open override val url: Url

通过 apiPathsbuildParameters 懒构建 url 属性。