title: How to send XML POST request using AFNetworking
body: <p>Read tons of answers and didn't found a simple answer:
  How can I send a simple XML to URL via POST and using AFNetworking ?</p>
  
  <pre><code>&lt;?xml version=’1.0’ encoding=’UTF-­‐8’?&gt;
  &lt;data&gt;
  &lt;login&gt;LOGIN&lt;/login&gt;
  &lt;password&gt;PASSWORD&lt;/password&gt;
  &lt;/data&gt;
  </code></pre>
  
  <p>URL for example: <a href="http://example.com/API/balance.php" rel="nofollow">http://example.com/API/balance.php</a></p>
  
  <p>When I use:</p>
  
  <pre><code>NSDictionary *params = @{@"login":@"login",@"password":@"password"};
  AFHTTPClient *client = [[AFHTTPClient alloc] initWithBaseURL:baseURL];
  [client setDefaultHeader:@"Content-Type" value:@"application/xml"];
  [client postPath:@"balance.php" parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
  ... some code ...
  }failure:^(AFHTTPRequestOperation *operation, NSError *error) {
          NSLog(@"Error retrieving data: %@", error);
  }];
  </code></pre>
  
  <p>I always get XML with error from API: Error Not well-formed (invalid token) in line 1</p>
  
  <p>when I used HTTP sniffer I see that Content-Type:application/x-www-form-urlencoded; charset=utf-8</p>
  
  <p>May be this is problem, but I don't know exactly.
  Using php with curl - get correct answer from API.</p>
  
  <p>Can anybody show working example with this XML request and URL ?</p>