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))
#4
Hi.

I replicated this in my own environment and as said your GET when you invoke the request is received by your api code which then tries to retrieve the body of the request (line 20 first code set)but the second parameter for requests.get package is request parameters aka ?x=12345 style query parameters,if as i suspect you wish to post the dictionary data in the second code set then the request needs to be a post method, this then is retrieved by the code on code set 1 line 20, and although failed for me the rest of the logic, it does return to the "r" variable the response code from flask, in my case HTTP 500, but worked to a fashion.
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, 08:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Scraping from multiple URLS to print in a single line. jb89 4 3,379 Jan-29-2020, 06:12 AM
Last Post: perfringo
  Error when decoding JSON ( Expecting ',' delimiter:) tortoise 7 47,185 Feb-18-2019, 08:27 AM
Last Post: tortoise
  os.rename Windows remove illegal char fgerrata 3 8,766 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