title: Flask, how to return a success status code for ajax call
body: <p>On the server-side, I am just printing out the json-as-dictionary to the console</p>
  
  <pre><code>@app.route('/',methods=['GET','POST'])
  @login_required
  def index():
      if request.method == "POST":
          print request.json.keys()
      return "hello world"
  </code></pre>
  
  <p>Now, whenever I make a post request via ajax, the console prints out the dictionary with the contents I need.</p>
  
  <p>On the client-side, I have been trying to use various methods to execute some jquery based on a successfull ajax call. I just realized that this might be an error on my server-side, i.e I am not sending any request header to tell jquery that its ajax call was a success.</p>
  
  <p>So how do I send an OK status back to my client to tell it everything is all right?</p>
  
  <p>For the sake of completeness, here is my clientside code</p>
  
  <pre><code>$.ajax({
      type: 'POST',
      contentType: 'application/json',
      data: JSON.stringify(myData),
      dataType: 'json',
      url: '/',
      success: function () {
          console.log("This is never getting printed!!")
      }});
  </code></pre>