我已发送了JSON请求。我收到200响应,这意味着已发送请求已被接受并且有响应。我试图查看从请求发回的完整响应。我尝试了3-4种不同的方式来查看响应,但无论我尝试什么,我都无法弄清楚如何查看完整的响应...任何人都可以帮我弄清楚如何查看信息..
请求 -
def createUserSynapse():
url = 'http://uat-api.synapsefi.com'
headers = {
'X-SP-GATEWAY' : 'client_id_asdfeavea561va9685e1gre5ara|client_secret_4651av5sa1edgvawegv1a6we1v5a6s51gv',
'X-SP-USER-IP' : '127.0.0.1',
'X-SP-USER' : 'ge85a41v8e16v1a618gea164g65',
'Contant-Type' : 'application/json',
}
payload = {
"logins":[
{
"email":"test@test.com",
}
],
"phone_numbers":[
"123.456.7890",
"test@test.com",
],
"legal_names":[
"Test name",
],
"extras":{
"supp_id":"asdfe515641e56wg",
"cip_tag":12,
"is_business":False,
}
}
print(url)
print(headers)
print(payload)
call = requests.post(url, data=json.dumps(payload), headers=headers)
print(call)
return call
我从请求中获得的响应(我有一行打印请求)...
<Response [200]>
答案 0 :(得分:0)
尝试将call
更改为
call.text
对于JSON试试
json.loads(call.text)
打印
print(json.loads(call.text))