HttpContentMixin class

Implementers

Constructors

HttpContentMixin()

Properties

bodyData → dynamic
取得最終帶入的 body
no setter
bodyType HttpBodyType
body 的類型, 預設 HttpBodyType.formUrlencoded
getter/setter pair
contentType ContentType?
contentType, null時根據 body 帶入對應contentType
no setter
formDataFormat ListFormat?
bodyTypeHttpBodyType.formData時, data的內容格式
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, dynamic>
getter/setter pair
port int?
getter/setter pair
queryParams Map<String, dynamic>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addBody({required String key, required dynamic value}) → void
加入鍵值body, 若是需要設定rawBody, 則改用setBody方法 key - 鍵值key value - 對應內容, 若為檔案則帶入MultipartFile
addBodys(Map<String, dynamic> iterable) → void
純粹的 key value pair iterable - 鍵值對應內容, 若需要帶入檔案則value帶入MultipartFile
addHeader(String key, {required dynamic value}) → void
添加抬頭 若是添加陣列到字串的參數, 則原先的字串會變為陣列並且加入新陣列 若是添加字串到陣列的參數, 則原因的陣列會添加一個新元素
addHeaders(Map<String, dynamic> iterable) → void
添加複數個抬頭
addQueryParam(String key, {required dynamic value}) → void
添加參數 若是添加陣列到字串的參數, 則原先的字串會變為陣列並且加入新陣列 若是添加字串到陣列的參數, 則原因的陣列會添加一個新元素
addQueryParams(Map<String, dynamic> iterable) → void
clear() → void
getKeyValueBody() Map<String, dynamic>
getRawBody() String
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseQuery(Map<String, String> query) → void
setBody({Map<String, dynamic>? keyValue, String? raw}) → void
直接設定 body, 將會清空當前的 body 重新設置新值 raw - 純字串內容 keyValue - 鍵值對應內容, 若需要帶入檔案則value帶入MultipartFile
setContentType(ContentType? type) → void
setQueryParams(Map<String, dynamic> iterable) → void
直接設定param, 會替代掉原有的
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited