title: Flask Security rest API
body: <p><strong>Context</strong><br>
  I'm creating a quote generation script using Python and Digital Ocean server (Ubuntu 16.04). Here's how it works: </p>
  
  <ol>
  <li>End user fills out a form on HubSpot hosted website  </li>
  <li>the form submission triggers a POST request to my server X.X.X.X:SpecificSocket</li>
  <li>that request is read into my python script using dictionaries</li>
  <li>using the ReportLab library the script creates a PDF quote for the user</li>
  <li>Said PDF is sent to the user in an email (using Postfix)  </li>
  </ol>
  
  <p>My script is isolated in the server using virtualenv. It is my understanding that POST requests can be intercepted and replicated byte for byte if the server does not have some form of encryption. Since the POST request contains names, emails, addresses even - it is super important that I protect that information from spambots.  </p>
  
  <p><strong>Question</strong><br>
  I can't seem to find any straight forward information regarding POST requests to a flask application. Does the flask framework by default have some basic encryption applied, or do I need to put that in myself? What recommendations would you make to ensure this is secure and safe, for both the end user and my server?  </p>
  
  <p><strong>Update</strong><br>
  Thanks to <a href="https://stackoverflow.com/users/996056/david-gomes">David Gomes</a> for answering the black and white part of my question. Mucho appreciated</p>
  
  <blockquote>
    <p>The POST request will be sent unencrypted and so you should set up SLS (HTTPS). There is some very good documentation on that <a href="http://flask.pocoo.org/snippets/111/" rel="nofollow noreferrer">here</a> which allows you to set up OpenSSL to serve requests with HTTPS with Flask only. Without this, all your requests are prone to being listened to by third parties.  </p>
  </blockquote>
  
  <p><a href="https://stackoverflow.com/users/4675937/roy">Roy</a>, thanks for linking that digital ocean tutorial. I was previously using <a href="https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-16-04" rel="nofollow noreferrer">this one</a> and had very little luck with actually getting nginx and uWSGI to talk properly. Hopefully I will have more luck here and I'll update with the full solution once I get things up and running!  </p>