title: Flask Restful read file
body: <p>I have a difficulty : I want to access to the content of a file when I posted with a request.</p>
  
  <p>client.py</p>
  
  <pre><code>url = 'http://127.0.0.1:5000/sendimage/test.jpg'
  filename = url.split('/')[-1]
  print filename
  files = {'media': open(filename, 'rb')}
  response = requests.post(url, files=files)
  </code></pre>
  
  <p>server.py</p>
  
  <pre><code>from flask import Flask, request
  from flask_restful import Api, Resource, reqparse
  import json
  
  app = Flask(__name__)
  api = Api(app)
  
  class sendImage(Resource):
  
      def post(self, pathImg):
          print "Receiving Image ..."
          # Extraction of the sent file
          return "null"
  
  api.add_resource(sendImage, '/sendimage/&lt;pathImg&gt;')
  
  if __name__ == '__main__':
      app.run(port='5000')
  </code></pre>
  
  <p>The question is:
  How can server.py read the data in the file sent by the client.py ??</p>