Python Forum
How to save Python Requests data sent to server?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to save Python Requests data sent to server?
#6
changing script to this:

@app.route('/postit2', methods=['GET', 'POST'])
def postit2():       
        d = request.files.to_dict()
        with open('/home/MadMartin/datapostfiles/EFL9.txt', 'w') as f:
            #read_data = f.read()
            f.write(str(d))           
            return '''ok''' 

saves this to EFL9:

{'file': <FileStorage: 'why.txt' (None)>}


so, doesn't look like the contents of the file can be sent in this way? Anyone know how to fix this? thanks
Reply


Messages In This Thread
RE: How to save Python Requests data sent to server? - by RedLeonard - Jul-05-2020, 10:33 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to save to multiple locations during save cubangt 1 566 Oct-23-2023, 10:16 PM
Last Post: deanhystad
  python requests library .JSON() error mHosseinDS86 6 3,461 Dec-19-2022, 08:28 PM
Last Post: deanhystad
  In SQL Server, mix data types. shiv11 0 889 Sep-21-2022, 12:50 PM
Last Post: shiv11
  How to modify python script to append data on file using sql server 2019? ahmedbarbary 1 1,233 Aug-03-2022, 06:03 AM
Last Post: Pedroski55
  Save data frame to .csv df.to.csv() mcva 1 1,552 Feb-03-2022, 07:05 PM
Last Post: mcva
  Python requests oauth2 access token herobpv 6 3,943 Sep-27-2021, 06:54 PM
Last Post: herobpv
  How to take the tar backup files form remote server to local server sivareddy 0 1,917 Jul-14-2021, 01:32 PM
Last Post: sivareddy
  SaltStack: MySQL returner save less data into Database table columns xtc14 2 2,186 Jul-02-2021, 02:19 PM
Last Post: xtc14
  How to save json data in a dataframe shantanu97 1 2,169 Apr-15-2021, 02:44 PM
Last Post: klllmmm
  Python Requests SSL Aussie 0 2,004 Jan-07-2021, 02:09 AM
Last Post: Aussie

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020