Alamofire 4 Request is returning NSArray, cannot figure out how to parse with SwiftyJSON in Swift 3
<p>The previous version of this Alamofire .POST request and SwiftyJSON parsing was working fine with Swift 2.2 and Xcode 7.  Updated to Swift 3.0, which required install of updated Alamofire (4.0.0) and updated SwiftyJSON.  After some syntax adjustments, everything now compiles.  </p>

<p>The problem is that my web app now appears to return an NSArray, whereas before, when the code worked, a nearly identical Request got an NSData return that SwiftyJSON would parse.  The following code shows the Request: </p>

<pre><code>   Alamofire.request("https://www.mywebappurl", method: .post, parameters: parameters)
   .responseJSON { (response:DataResponse&lt;Any&gt;) in

                    if let data = response.result.value as? Data {
</code></pre>

<p>The data variable is never assigned because the response type is not NSData.  Tried to cast to that type by changing the last line to this:</p>

<pre><code>    let data = response.result.value as! Data
</code></pre>

<p>That version compiles fine, but as soon as you trigger the Request you get an error: Could not cast value of type '__NSArrayI' (0x105a37c08) to 'NSData'</p>

<p>Note that the request is returning data as expected.  And in the previous Alamofire this data was NSData without any action being taken to convert it.  Since it appears from the aforementioned error that the returned data is an array already, has it already been parsed by Alamofire?  Or is there something that can be done to make SwiftyJSON parse it like it was parsed before?</p>

<p><strong>EDIT</strong></p>

<p>Since the current type being returned is an NSArray, and the web app is sending an array, it seems possible that the SwiftyJSON parsing is no longer necessary?  Tried the following code:</p>

<pre><code>Alamofire.request("https://www.mywebappurl", method: .post, parameters: parameters)
.responseJSON { (response:DataResponse&lt;Any&gt;) in

let testdata = response.result.value as! NSArray
print(testdata[0])
</code></pre>

<p>Which yielded this output in the Xcode "All Output" screen:</p>

<pre><code>{
  1 = "08/01/16";
  2 = 285;
  3 = 160;
}
</code></pre>

<p>It's not clear to me if that means testdata is an array of arrays, an array of dictionaries, or an array of unparsed strings.  So as an alternative to answering the question of "How can one obtain an NSData response from this Alamofire request", a response to the question of "What one line of code, if any, can be used to obtain the integer value 285 from the NSArray testdata shown above?" would also resolve the problem.</p>