HttpClientMultipart

用于构建 multipart/form-data 请求体的构建器。

当你需要上传文件或在单个请求中发送混合内容(如文本字段和文件)时, 你可以在 HttpClient.postMultipartHttpClientRequest.setMultipartBody 的 lambda 块中使用此接口。

Author

M8Test, [email protected], https://m8test.com

Functions

Link copied to clipboard
abstract fun addFile(name: String, scriptFile: ScriptFile, fileName: String?, fileType: String?, headers: Map<String, String>?)

向 multipart 表单中添加一个文件部分。

Link copied to clipboard
abstract fun addText(name: String, value: String, headers: Map<String, String>?)

向 multipart 表单中添加一个文本字段。