tristanhimmelman/AlamofireObjectMapper

How to make post in AlamofireObjectMapper ?

mash3l777 opened this issue · 2 comments

How to make post in AlamofireObjectMapper ?

Here is the code for making .post request:-

let sessionsManager = AlamofireAppManager.session
sessionsManager.startRequestsImmediately = true
let dataRequest: DataRequest = sessionsManager.request("your api url", method: .post, parameters: "parameter", encoding: "encoding if need", headers: "header")

dataRequest.responseObject { (response: DataResponse) in

print(response)
}

If there is any confusion then feel free to ask the question.

Yes Thank you Bro
I used like this :

Alamofire.request(URL , method: .post , parameters: parameters, encoding: JSONEncoding.default).responseObject { (response: DataResponse<LoginResultDto>)
                 in