Python Forum
Unable to convert request response.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to convert request response.
#2
Usually so dos API give back json,so should not use text.
response = requests.request("GET", url, headers=headers, params=querystring)
json_data = response.json()
print(json_data)
So what you should get back here is Python dictionary,as Requests has build in encoding and decoding for json.
johnboy1974 likes this post
Reply


Messages In This Thread
RE: Unable to convert request response. - by snippsat - Apr-04-2021, 08:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to request image from FORM Data usman 0 1,079 Aug-18-2022, 06:23 PM
Last Post: usman
  request.get to read large response pythonlearner1 7 3,559 Apr-05-2022, 08:21 PM
Last Post: pythonlearner1
  how can I correct the Bad Request error on my curl request tomtom 8 5,412 Oct-03-2021, 06:32 AM
Last Post: tomtom
  Empty response to request causing .json() to error t4keheart 1 10,398 Jun-26-2020, 08:35 PM
Last Post: bowlofred
  ImportError: cannot import name 'Request' from 'request' abhishek81py 1 4,075 Jun-18-2020, 08:07 AM
Last Post: buran
  Unable post request to AWS elasticsearch service Rupini 0 1,972 May-18-2020, 08:27 AM
Last Post: Rupini
  Issues parsing the response from a request garnold 3 2,728 May-14-2019, 12:39 PM
Last Post: snippsat
  Unable to print the exact Float values when I convert LIST to Sequence of Tuples? preethamalluri 1 2,554 Jul-12-2018, 09:03 AM
Last Post: buran
  unable to convert text file in dictionary purnima1 6 4,559 Apr-02-2018, 07:44 AM
Last Post: purnima1

Forum Jump:

User Panel Messages

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