title: Set HTTP Body to AFNetworking instead of using native request
body: <p>Ive been recently trying to get AFNetworking to work as i did with native request, i have been always using AFNetworking for uploading POST or GET.but it never uploaded my image correct. it always uploaded to the server damaged and I've explained about the issue in this reference : <a href="https://stackoverflow.com/questions/34881546/uploading-image-to-server-reached-damaged-using-afnetworking/34882786#34882786">Uploading image to server reached damaged using AFNetworking</a></p>
  
  <p>I've tried to use native <code>NSURLConnection.sendSynchronousRequest</code> with HTTP Body and it has been uploaded and not damaged. and this code fully work but i need it in AFNetworking because it only supports IOS 8 + and for more reasons.</p>
  
  <pre><code>        let baseURL = ""
          let selectedImage = self.userImage.image
          let imageData = NSData(data: UIImageJPEGRepresentation(selectedImage!, 0.5)!)
  
          let request = NSMutableURLRequest()
          request.URL = NSURL(string: baseURL)
          request.HTTPMethod = "POST"
          request.addValue("image/jpeg", forHTTPHeaderField: "Content-Type")
          let body = NSMutableData(data: imageData)
          request.HTTPBody = body
  
   do {
              let responseData = try NSURLConnection.sendSynchronousRequest(request, returningResponse:nil)
              let responseString = String(data: responseData, encoding: NSUTF8StringEncoding)
  
              print("User image successfully uploaded navigating to home services")
  
  
          } catch (let error as NSError) {
  }
  </code></pre>