title: How to use curl to send file to Google Cloud Function?
body: <p>I have the following Cloud function which is mainly based from the documentation:</p>
  
  <pre><code>def hello_world(request):
      if request.method == 'GET':
          print('GET')
      elif request.method == 'PUT':
          print("PUT")
      # This code will process each file uploaded
      files = request.files.to_dict()
      print("files: ",files)
      for file_name, file in files.items():
          file.save(get_file_path(file_name))
          print('Processed file: %s' % file_name)
  
      # Clear temporary directory
      for file_name in files:
          file_path = get_file_path(file_name)
          os.remove(file_path)
  
      return "Done!"
  </code></pre>
  
  <p>With the following curl command I try to upload a file to this function, the file can either be an image or a pdf:</p>
  
  <blockquote>
    <p>curl -i -T myFile <a href="https://Link-to-cloudfunction" rel="nofollow noreferrer">https://Link-to-cloudfunction</a> --verbose</p>
  </blockquote>
  
  <p>When doing this, my function prints the "PUT" and immediately returns "Done". Hence, the files dictionary is just empty.</p>
  
  <p>Can anyone help me out?</p>