Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to get the data
#4
use this code
response = requests.get('http://xx:8080/maintenance/job?jobType=IMPORT&resultLimit=30')
if resposnse.ok:
    data = response.json()
    with open('data.json', 'w') as f:
        json.dump(data, f, indent=4)
to save the json response to file, nicely formatted
e.g. without u in front of the keys
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Unable to get the data - by pythonFresher - May-22-2019, 12:21 PM
RE: Unable to get the data - by ichabod801 - May-22-2019, 12:56 PM
RE: Unable to get the data - by michalmonday - May-22-2019, 01:10 PM
RE: Unable to get the data - by buran - May-22-2019, 01:23 PM
RE: Unable to get the data - by pythonFresher - May-22-2019, 02:35 PM
RE: Unable to get the data - by buran - May-22-2019, 03:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to request image from FORM Data usman 0 1,022 Aug-18-2022, 06:23 PM
Last Post: usman
  Unable to Validate csv blanck data and write in csv prashant18 0 1,567 Jul-25-2020, 12:08 PM
Last Post: prashant18
  Unable to do the proper split using re.sub incase of missing data. Karz 1 1,904 Nov-17-2019, 05:58 PM
Last Post: buran
  unable to indent json data dataplumber 4 3,076 Oct-22-2019, 01:55 PM
Last Post: dataplumber
  Unable to read data from string base64 representing a .xlsx file max 2 15,423 Apr-05-2018, 07:58 PM
Last Post: max

Forum Jump:

User Panel Messages

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