Python Forum
expecting value: line 1 column 1 (char 0) in print (r.json))
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
expecting value: line 1 column 1 (char 0) in print (r.json))
#2
hi
I am slightly confused here as you mention that the second piece of code is posting a request and yet you are using the requests GET function. If you are looking to post that data variable object in the second piece of code then the parameters for that function are requests.post(url, data, json), I have not looked at the requests package specifically to see what they appertain to.
At the moment you are trying to decode the data expected from the GET which I will be not there i.e. None and hence the char(0),the variable r in the post will actually contain the response code I expect something like r: <Response [500]> for example if the whole thing failed and consequently you can not json that either so just chane it for a print® if you want to test the response result
Regards
-------- *
“Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read.”
Reply


Messages In This Thread
RE: expecting value: line 1 column 1 (char 0) in print (r.json)) - by nuffink - Jun-05-2020, 04:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Scraping from multiple URLS to print in a single line. jb89 4 3,397 Jan-29-2020, 06:12 AM
Last Post: perfringo
  Error when decoding JSON ( Expecting ',' delimiter:) tortoise 7 47,276 Feb-18-2019, 08:27 AM
Last Post: tortoise
  os.rename Windows remove illegal char fgerrata 3 8,801 Jan-03-2018, 04:39 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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