How to post a submission in swift

  • stevetripleo
    Asked on March 14, 2018 at 3:20 PM

    My arguments never get passed through to fill the form questions. Can you see anything I am doing wrong?

    let url = URL(string: "https://api.jotform.com/form/\(Constant.jotformFormId)/submissions?apiKey=\(Constant.jotformApiKey)")!

        var request = URLRequest(url: url)

        request.httpMethod = "POST"

        let postString = "submission[0]=answer1&submission[1]=answer2"

        request.httpBody = postString.data(using: .utf8)


  • Richie JotForm Support
    Replied on March 14, 2018 at 4:20 PM

    I'm not really familiar with swift programming but these articles may help you.

    How-to-send-Submissions-to-Your-MySQL-Database-Using-PHP

    -Send-Submission-Data-via-Post-Method-and-Thank-You-Settings


    Hope this information helps.

    Please let us know if we can be of further assistance.