Q:

Swift REST POST losing quotes?

Somehow I've ended up completely stuck on what should be an easy REST call.  I have a restful service (in node) that is expecting an array of strings.  Every time I call with what appears to be a valid parameter, I get an error from the server that looks like it was trying to parse the string as an integer, which makes me think it is losing the quotes around the string somewhere.
Here's the original Swift (3) code (with two more variants at the end).  "id" and "parmvalue" are passed to this function.
let url = URL(string: "\(root)path/\(id)/myendpoint")
var request = URLRequest(url:url!)
request.httpMethod = "POST"
request.addValue("application/json",forHTTPHeaderField: "Content-Type")
let params = [ "parm" : [ parmvalue ] ]
do {
    let jsonParams = try JSONSerialization.data(withJSONObject: params)
    request.httpBody = jsonParams
    let task = URLSession.shared.dataTask(with: request, completionHandler: {(data, response, error) -> Void in
...etc

Here's the server code:
    app.post('/path/:id/myendpoint', globals.authentication, function(req, res){
        var param = JSON.parse(req.param('parm', "[]"));
        var Id = req.param('id', -1);
...etc

Passing in a parmvalue = "898e1ac8-4892-4e6e-89cb-4b2ea9306f75.jpg", I get a 500 response from the server, and the data passed to the completionHandler for the dataTask looks like:

SyntaxError: Unexpected token e

and a stack trace pointing right at that "var param" line.  The unexpected token that is returned almost always corresponds to the first non-numeric value in the guid.
Here was variant 1 (just hardcode the json, it isn't that complicated)
let url = URL(string: "\(root)path/\(id)/myendpoint")
var request = URLRequest(url:url!)
request.httpMethod = "POST"
request.addValue("application/json",forHTTPHeaderField: "Content-Type")
let testparamsString = "{ \"photos\" : [ \"\(filename)\" ] }"
let testparams = testparamsString.data(using: .utf8)
request.httpBody = testparams
...etc

And here was variant 2 (if json doesn't work, try query param format)
let url = URL(string: "\(root)path/\(id)/myendpoint")
var request = URLRequest(url:url!)
request.httpMethod = "POST"
let queryparams = "parm[]=\(filename.stringByAddingPercentEncodingForFormUrlencoded()!)"
request.httpBody = queryparams.data(using: .utf8)

(note that all of the code fragments have been somewhat anonymized wrt variable names and values, and all three variations in Swift generate the same response from the server, so if there's something wonky in a particular fragment, it's probably my anonymizing by hand)
Just for grins, here's part of a C# app that also calls this endpoint (using the RestSharp library) and works - so I pretty much trust that the server code is correct:
var request = new RestRequest($"/path/{id}/myendpoint", Method.POST);
var parmArray = new JArray();
parmArray.Add(parmvalue);
var jsonParms = JsonConvert.SerializeObject(parmArray, Formatting.None);
request.AddParameter("parm", jsonParms);

A:

Variant 1 was close, but it needed an extra (escaped) backslash to keep those quotes in there.  Here's what I ended up with:
    let url = URL(string: "\(root)path/\(id)/myendpoint")
    var request = URLRequest(url:url!)
    request.httpMethod = "POST"
    request.addValue("application/json",forHTTPHeaderField: "Content-Type")
    let paramsString = "{ \"photos\" : \"[\\\"\(filename)\\\"]\" }"
    request.httpBody = paramsString.data(using: .utf8)

