如何将参数作为swift ios中的字典传递给post请求?

时间:2018-03-23 09:36:32

标签: ios swift postman

dashBoardApplyListCriteria
这里dashBoardApplyListCriteria参数是一个字典。如何在swift ios中将字典作为参数传递。

这是我的代码

let parameters: NSDictionary = [ "sessionId":sessionId, "jobId":jobId, "dashBoardApplyListCriteria":["1":["Recruiter"], "selectedBucketStatus":"Applies", "allJobsOrMyJobs":"AllJobs", "jobStatus":[0,1,2], "paginationStartNo":0, "paginationHowMuch":5], ] ]

    let parameters: [String: Any] =
        [
        "sessionId":sessionId,
        "jobId":jobId,
        "dashBoardApplyListCriteria":["actorList":["Recruiter"],
                                      "selectedBucketStatus":"Applies",
                                      "allJobsOrMyJobs":"AllJobs",
                                      "jobStatus":[0,1,2],
                                      "paginationStartNo":0,
                                      "paginationHowMuch":5],
        "applyListFilterCriteria":["appliesToBeSorted":["name":"dateApply","isAscending":true]]
    ]

让jsonData =试试? JSONSerialization.data(withJSONObject:parameters)

0 个答案:

没有答案