遵照:NSCopying,NSObject,NSSecureCoding
聲明處:AFURLRequestSerialization.h
概述
?AFURLRequestSerialization協議是被進行指定HTTP請求時,編碼參數的對象使用。請求序列化可以將參數編碼為查詢字符串和HTTP主體,并根據需要設置適當的HTTP頭字段。
比如,JSON請求序列化可以將請求的HTTP主體設置為JSON表示,設置HTTP頭字段Content-Type的值為applicaton/json.
任務
必須實現方法:– requestBySerializingRequest:withParameters:error:
實例方法
– requestBySerializingRequest:withParameters:error:
- (nullable NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request withParameters:(nullable id)parameters error:(NSError *_Nullable __autoreleasing *)error
討論
返回一個帶編碼參數的請求。
參數
request
原始請求
參數
待編碼的參數
error
編碼請求參數時發生的錯誤
返回值
一個序列化的請求
聲明處
AFURLRequestSerialization.h
// END