Skip to content

Releases: rogermolas/RMHttp

Form Data File Container

10 Feb 11:59
Compare
Choose a tag to compare
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

10 Feb 06:29
Compare
Choose a tag to compare
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

Updates Added:
#6 #5

Add Form-data support

13 Jan 07:10
Compare
Choose a tag to compare

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

07 May 11:33
Compare
Choose a tag to compare

Swift 5.0 Support
Fix crash if error is null
Fix logging optional value

[BUG] : Handle null response on network Time Out

23 Sep 05:43
Compare
Choose a tag to compare

Add Codable parsing support

28 Jun 13:03
Compare
Choose a tag to compare
v1.3

version 1.3

Add Test Case

29 May 13:14
Compare
Choose a tag to compare
v1.2.2

[Build] : Increment build number

Hot Fix issue #3, Added debugging flag

25 May 06:52
Compare
Choose a tag to compare
v1.2.1

[FIX] :  #3:  [BUG] : Status code, Response body not returning

Change completion handler structure

22 May 09:08
Compare
Choose a tag to compare
v1.2

Change completion handler structure

Support IOS 10

25 Apr 08:57
Compare
Choose a tag to compare
v1.1

[RELEASE] : v1.1