Releases: rogermolas/RMHttp
Releases · rogermolas/RMHttp
Form Data File Container
var files = [RMFormDataFile]()
let file = RMFormDataFile("picture", image.jpegData(compressionQuality: 1.0), "avatar.jpeg", "image/jpeg")
files.append(file)
let params = [
"field1": arbitration.auction.id!,
"description": "sample test"
]
let request = APIRequestBuilder().buildFormRequest(api: urlString, params: param, files: files)
Param Container, Form-data add file
let name1 = RMParams(key: "names[]", value: "roger")
let name2 = RMParams(key: "names[]", value: "molas")
let booleanType = RMParams(key: "boolean", value: true)
let number = RMParams(key: "number", value: 100)
let floatNumber = RMParams(key: "float", value: 1.0)
let params = [name1, name2, booleanType, number, floatNumber]
let urlString = "https://httpbin.org/post"
request = RMRequest(urlString, .GET(.URLEncoding), params, nil)
return request
Form-data Add file
let request = RMRequest(url: URL(string: urlString)!)
request.addForm(field: "file", file: imgData, fileName: "image.jpeg", mimeType: "image/jpeg")
request.setHttp(method: .POST(.FomDataEncoding))
return request
Add Form-data support
Add form-data fields from params
RMRequest(urlString, method: .POST(.FomDataEncoding), parameters: params, hearders: nil)
Custom form data request
let request = RMRequest(url: URL(string: urlString)!)
request.setHttp(method: .POST(.FomDataEncoding))
request.setFormData(fields: params)
or
request.setHttpBody(data: customDataBody)
Swift 5
Swift 5.0 Support
Fix crash if error is null
Fix logging optional value
[BUG] : Handle null response on network Time Out
FIX : issue #4
Add Codable parsing support
v1.3 version 1.3
Add Test Case
v1.2.2 [Build] : Increment build number
Hot Fix issue #3, Added debugging flag
v1.2.1 [FIX] : #3: [BUG] : Status code, Response body not returning
Change completion handler structure
v1.2 Change completion handler structure
Support IOS 10
v1.1 [RELEASE] : v1.1