How to make post in AlamofireObjectMapper ?
mash3l777 opened this issue · 2 comments
mash3l777 commented
How to make post in AlamofireObjectMapper ?
tiwari1amrit commented
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.
mash3l777 commented
Yes Thank you Bro
I used like this :
Alamofire.request(URL , method: .post , parameters: parameters, encoding: JSONEncoding.default).responseObject { (response: DataResponse<LoginResultDto>)
in