title: Alamofire Mailchimp API 3.0 subscribe
body: <p>I am trying to subscribe new user to Mailchimp list using Alamofire.
  Problem starts when I'm trying to subscribe new user with .post method and JSONObject as a parameter:</p>
  
  <pre><code>func subscribeMail(){
  
  let credentialData = "&lt;my_api_key&gt;".data(using: String.Encoding.utf8)!
  let base64Credentials = credentialData.base64EncodedString(options: [])
  let headers = ["Authorization": "Basic \(base64Credentials)"]
  
  let url = "https://us11.api.mailchimp.com/3.0/lists/&lt;my_list_id&gt;/members/"
  
  let jsonObj: [String: AnyObject] = [
      "mail_address" : "testMailAddress@gmail.com" as AnyObject,
      "status" : "subscribed" as AnyObject,
  ]
  
  let valid = JSONSerialization.isValidJSONObject(jsonObj)
  print(valid)
  
  Alamofire.request(url, method: .post, parameters: jsonObj , encoding: URLEncoding.default , headers: headers).responseJSON{response in
      if response.result.isFailure {
         print("Failed") 
      }
      else if (response.result.value as? [String: AnyObject]) != nil {
          print(response)
          }
      }
  
  }
  </code></pre>
  
  <p>I get back status code 400:</p>
  
  <pre><code>SUCCESS: {
  detail = "We encountered an unspecified JSON parsing error.";
  instance = "";
  status = 400;
  title = "JSON Parse Error";
  type = "http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/";
  }
  </code></pre>
  
  <p>In Mailchimp documentation:</p>
  
  <p><strong>JSONParseError</strong></p>
  
  <p><strong>We encountered an unspecified JSON parsing error.
  This error means that your JSON was formatted incorrectly or was considered invalid or incomplete.</strong></p>
  
  <p>As you can see I am checking my jsonObj if its valid. So I dont get this parsing error..</p>
  
  <p>In Mailchimp API 3.0 its written that just email_address and status fields are needed to subscribe new mail.</p>
  
  <p>If I try to to send request with Alamofire using .get method with some mail address that is already subscribed, everything works fine, I can receive all data from Mailchimp.</p>
  
  <p>Is there really problem with my jsonObj or is it somewhere else?</p>