title: Can't POST from app to Slack Incoming Webhook
body: <p>I'm able to POST to my Slack Incoming Webhook using curl: </p>
  
  <pre><code>curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello world"}' https://hooks.slack.com/services/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
  </code></pre>
  
  <p>But when I use </p>
  
  <pre><code>$.ajax({
      url: "https://hooks.slack.com/services/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",
      data: '{"text": "Hello world"}',
      type: "POST",
      contentType: "application/json"
  })
      .done(function (reply) {
          console.log("POST to Slack succeeded")
      })
      .fail(function (xhr, status, errorThrown) {
          console.log("Error in POST to Slack: " + errorThrown.toString())
      })
  </code></pre>
  
  <p>in a page of my app that is served by localhost:8090, I get the error:</p>
  
  <pre><code>jquery.js:9536 OPTIONS https://hooks.slack.com/services/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 
  400 (Bad Request)
  XMLHttpRequest cannot load https://hooks.slack.com/services/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. 
  Response for preflight has invalid HTTP status code 400
  </code></pre>
  
  <p>Normally a POST from my page would go to my server, which served the page. So I think my confusion has to do with understanding how Webhooks work. I thought that the same-origin policy prohibited me from POSTing to an arbitrary url. But why does the curl command work, and how do I get my page to do what curl does?</p>
  
  <p>Do I need to send the POST from my server, instead of from the client browser?</p>