title: pho.to API Request Failing in Swift
body: <p>Im currently trying to work with the <a href="http://developers.pho.to/documentation/sending-requests" rel="nofollow noreferrer">pho.to</a> API in my iOS application. I am experimenting with making simple requests according to the documentation, however I cannot seem to get the request to go through successfully. Inside my API client file, I have this code:</p>
  
  <pre><code>let dataStr = """
              &lt;image_process_call&gt;
                  &lt;image_url&gt;http://developers.pho.to/img/girl.jpg&lt;/image_url&gt;
                  &lt;methods_list&gt;
                      &lt;method order="1"&gt;
                          &lt;name&gt;desaturation&lt;/name&gt;
                      &lt;/method&gt;
                      &lt;method order="2"&gt;
                          &lt;name&gt;caricature&lt;/name&gt;
                          &lt;params&gt;type=1;crop_portrait=true&lt;/params&gt;
                      &lt;/method&gt;
                  &lt;/methods_list&gt;
                  &lt;thumb1_size&gt;100&lt;/thumb1_size&gt;
              &lt;/image_process_call&gt;
              """
  
  let encodedStr = dataStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: " ", with: "")
  
  let signData = encodedStr.hmac(key: key)
  
  let urlStr = "https://opeapi.ws.pho.to/addtask/?app_id=\(appId)&amp;key=\(key)&amp;sign_data=\(signData)&amp;data=\(encodedStr.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)!))"
  </code></pre>
  
  <p>The HMAC encoding is being done according to <a href="https://stackoverflow.com/questions/26970807/implementing-hmac-and-sha1-encryption-in-swift">this</a> Stack Overflow post. Unfortunately when making a request to this URL using URLSession I get this response:</p>
  
  <pre><code>&lt;?xml version=\"1.0\"?&gt;\n&lt;image_process_response&gt;&lt;status&gt;SecurityError&lt;/status&gt;&lt;err_code&gt;614&lt;/err_code&gt;&lt;description&gt;Error in POST parameters: one or more parameters (DATA , SIGN_DATA or APP_ID) are empty&lt;/description&gt;&lt;/image_process_response&gt;
  </code></pre>
  
  <p>I feel like my issue is more related to actually forming the request rather than something specific to the API itself. I know my code is a little messy, however I was hoping that somebody could point me in the right direction in terms of making a request like this. Thanks!</p>