Skip to main content

GraphQL request - No body returned for response in Postman

I copied the following request from Chrome DevTools using "Copy as cURL (bash)", but it does not seem to be working in Postman. I get no response.

curl 'https://www.property.com.au/api/graphql' \
  -H 'authority: www.property.com.au' \
  -H 'accept: */*' \
  -H 'accept-language: en-US,en;q=0.9,cs;q=0.8' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'cookie: Country=DE; pcauid=3332ff7c454fdd04c2aae1eeb80273af8f6aa6ed; split_audience=e; fullstory_audience_split=B; featureToggles=; _gcl_au=1.1.157284193.1683271357; myid5_id=0; AMCVS_341225BE55BBF7E17F000101%40AdobeOrg=1; s_cc=true; DM_SitId1467=1; DM_SitId1467SecId12715=1; DM_SitId1467SecId12714=1; tracking_acknowledged=true; AMCV_341225BE55BBF7E17F000101%40AdobeOrg=-330454231%7CMCIDTS%7C19487%7CMCMID%7C62250887986470247984540357289727589553%7CMCAAMLH-1684253980%7C6%7CMCAAMB-1684253980%7CRKhpRz8krg2tLO6pguXWp5olkAcUniQYPHaMWWgdJ3xzPWQmdj0y%7CMCOPTOUT-1683656379s%7CNONE%7CMCAID%7CNONE%7CvVersion%7C3.1.2; ab.storage.deviceId.b2062aeb-858c-41cc-b98c-ff2aaec84951=%7B%22g%22%3A%22764365e0-f80e-f779-5f68-89a25f260bf0%22%2C%22c%22%3A1683271357733%2C%22l%22%3A1683649181477%7D; _gid=GA1.3.1282212224.1683649182; autocompleteSelectedTabIndex=2; s_sq=rea-live%3D%2526c.%2526a.%2526activitymap.%2526page%253Dpca%25253Aproperty_research%25253Adetails%25253Aproperty_details%2526link%253DProperty%252520homepage%2526region%253Droot%2526pageIDType%253D1%2526.activitymap%2526.a%2526.c%2526pid%253Dpca%25253Aproperty_research%25253Adetails%25253Aproperty_details%2526pidt%253D1%2526oid%253Dhttps%25253A%25252F%25252Fwww.property.com.au%25252F%2526ot%253DA; KP_UIDz-ssn=07qxSv40h7FnTvonbyw30ym7QD0XCYJcOxsY1Ecti1SbN79RwhKMWELtkdHEelWX47LdYYNZRiRWtN2cqZczFk7bL82n1q8OGeVBs79uMo9Bwd8GZIHNa0lJRkVgiLX0J0osCceGbuJ7mNJY2VFaP6M6KcMJMHIHpQSOZJfodu28E2rflD29pWX51UHF47h; KP_UIDz=07qxSv40h7FnTvonbyw30ym7QD0XCYJcOxsY1Ecti1SbN79RwhKMWELtkdHEelWX47LdYYNZRiRWtN2cqZczFk7bL82n1q8OGeVBs79uMo9Bwd8GZIHNa0lJRkVgiLX0J0osCceGbuJ7mNJY2VFaP6M6KcMJMHIHpQSOZJfodu28E2rflD29pWX51UHF47h; utag_main=v_id:0187eaca8be60022b616ebb2cb780506f005d06700bd0$_sn:4$_se:13$_ss:0$_st:1683654275050$vapi_domain:property.com.au$ses_id:1683649173571%3Bexp-session$_pn:5%3Bexp-session$_prevpage:pca%3Ahome%3Ahomepage%3Bexp-1683656076120; s_nr30=1683652476124-Repeat; _ga_F962Q8PWJ0=GS1.1.1683651006.5.1.1683652476.0.0.0; _gat_gtag_UA_143679184_2=1; _ga_FNS14GD7LR=GS1.1.1683649181.5.1.1683652476.0.0.0; _ga=GA1.1.271517619.1683271357; ab.storage.sessionId.b2062aeb-858c-41cc-b98c-ff2aaec84951=%7B%22g%22%3A%229e7c7b4f-e477-c1a2-a3be-65b345dd1a04%22%2C%22e%22%3A1683654277264%2C%22c%22%3A1683649181475%2C%22l%22%3A1683652477264%7D; nol_fpid=44qwg6pw9iyo0s4gs1iw4zvmzksjg1683271357|1683271357208|1683652477454|1683652477740' \
  -H 'newrelic: eyJ2IjpbMCwxXSwiZCI6eyJ0eSI6IkJyb3dzZXIiLCJhYyI6IjEzMDExIiwiYXAiOiIxODM0ODM1MjkxIiwiaWQiOiI4ODEzODFhMzM3OGY4ODg5IiwidHIiOiI4NDFjMWI2ZDM4OWFjNzE1ZTQ4NDkxMTZhNmJlZjkwMCIsInRpIjoxNjgzNjUyNDc4MjYyLCJ0ayI6IjEwMjI2ODEifX0=' \
  -H 'origin: https://www.property.com.au' \
  -H 'pragma: no-cache' \
  -H 'referer: https://www.property.com.au/' \
  -H 'sec-ch-ua: "Chromium";v="112", "Google Chrome";v="112", "Not:A-Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'traceparent: 00-841c1b6d389ac715e4849116a6bef900-881381a3378f8889-01' \
  -H 'tracestate: 1022681@nr=0-1-13011-1834835291-881381a3378f8889----1683652478262' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36' \
  -H 'x-kpsdk-cd: {"workTime":1683652478204,"id":"b1ea611acce10dc954502a0b916fd1f3","answers":[6,13],"duration":3.7,"d":53,"st":1683652476003,"rst":1683652476056}' \
  -H 'x-kpsdk-ct: 07qxSv40h7FnTvonbyw30ym7QD0XCYJcOxsY1Ecti1SbN79RwhKMWELtkdHEelWX47LdYYNZRiRWtN2cqZczFk7bL82n1q8OGeVBs79uMo9Bwd8GZIHNa0lJRkVgiLX0J0osCceGbuJ7mNJY2VFaP6M6KcMJMHIHpQSOZJfodu28E2rflD29pWX51UHF47h' \
  --data-raw $'{"operationName":"LocationSuggestions","variables":{"queryText":"Surfers"},"query":"query LocationSuggestions($queryText: String\u0021) {\\n  locationSuggestions(queryText: $queryText) {\\n    addresses {\\n      text\\n      locationType\\n      propertyId\\n      __typename\\n    }\\n    schools {\\n      text\\n      locationType\\n      url\\n      __typename\\n    }\\n    suburbs {\\n      text\\n      locationType\\n      url\\n      __typename\\n    }\\n    __typename\\n  }\\n}"}' \
  --compressed

I've seen this multiple times on different websites. It seems that when the query (at --data-raw lines) is more complicated, it does not work. Every time the query was just like a "normal JSON", it was working in Postman with no issues.

Can anybody advise me on how to make this work in Postman?

My end goal is to be able to run the Python code generated in Postman and get the response.

import requests
import json

url = "https://www.property.com.au/api/graphql"

payload = json.dumps({
  "operationName": "LocationSuggestions",
  "variables": {
    "queryText": "Surfers"
  },
  "query": "query LocationSuggestions($queryText: String!) {\n  locationSuggestions(queryText: $queryText) {\n    addresses {\n      text\n      locationType\n      propertyId\n      __typename\n    }\n    schools {\n      text\n      locationType\n      url\n      __typename\n    }\n    suburbs {\n      text\n      locationType\n      url\n      __typename\n    }\n    __typename\n  }\n}"
})
headers = {
  'authority': 'www.property.com.au',
  'accept': '*/*',
  'accept-language': 'en-US,en;q=0.9,cs;q=0.8',
  'cache-control': 'no-cache',
  'content-type': 'application/json',
  'cookie': 'Country=DE; pcauid=3332ff7c454fdd04c2aae1eeb80273af8f6aa6ed; split_audience=e; fullstory_audience_split=B; featureToggles=; _gcl_au=1.1.157284193.1683271357; myid5_id=0; AMCVS_341225BE55BBF7E17F000101%40AdobeOrg=1; s_cc=true; DM_SitId1467=1; DM_SitId1467SecId12715=1; DM_SitId1467SecId12714=1; tracking_acknowledged=true; AMCV_341225BE55BBF7E17F000101%40AdobeOrg=-330454231%7CMCIDTS%7C19487%7CMCMID%7C62250887986470247984540357289727589553%7CMCAAMLH-1684253980%7C6%7CMCAAMB-1684253980%7CRKhpRz8krg2tLO6pguXWp5olkAcUniQYPHaMWWgdJ3xzPWQmdj0y%7CMCOPTOUT-1683656379s%7CNONE%7CMCAID%7CNONE%7CvVersion%7C3.1.2; ab.storage.deviceId.b2062aeb-858c-41cc-b98c-ff2aaec84951=%7B%22g%22%3A%22764365e0-f80e-f779-5f68-89a25f260bf0%22%2C%22c%22%3A1683271357733%2C%22l%22%3A1683649181477%7D; _gid=GA1.3.1282212224.1683649182; autocompleteSelectedTabIndex=2; s_sq=rea-live%3D%2526c.%2526a.%2526activitymap.%2526page%253Dpca%25253Aproperty_research%25253Adetails%25253Aproperty_details%2526link%253DProperty%252520homepage%2526region%253Droot%2526pageIDType%253D1%2526.activitymap%2526.a%2526.c%2526pid%253Dpca%25253Aproperty_research%25253Adetails%25253Aproperty_details%2526pidt%253D1%2526oid%253Dhttps%25253A%25252F%25252Fwww.property.com.au%25252F%2526ot%253DA; KP_UIDz-ssn=07qxSv40h7FnTvonbyw30ym7QD0XCYJcOxsY1Ecti1SbN79RwhKMWELtkdHEelWX47LdYYNZRiRWtN2cqZczFk7bL82n1q8OGeVBs79uMo9Bwd8GZIHNa0lJRkVgiLX0J0osCceGbuJ7mNJY2VFaP6M6KcMJMHIHpQSOZJfodu28E2rflD29pWX51UHF47h; KP_UIDz=07qxSv40h7FnTvonbyw30ym7QD0XCYJcOxsY1Ecti1SbN79RwhKMWELtkdHEelWX47LdYYNZRiRWtN2cqZczFk7bL82n1q8OGeVBs79uMo9Bwd8GZIHNa0lJRkVgiLX0J0osCceGbuJ7mNJY2VFaP6M6KcMJMHIHpQSOZJfodu28E2rflD29pWX51UHF47h; utag_main=v_id:0187eaca8be60022b616ebb2cb780506f005d06700bd0$_sn:4$_se:13$_ss:0$_st:1683654275050$vapi_domain:property.com.au$ses_id:1683649173571%3Bexp-session$_pn:5%3Bexp-session$_prevpage:pca%3Ahome%3Ahomepage%3Bexp-1683656076120; s_nr30=1683652476124-Repeat; _ga_F962Q8PWJ0=GS1.1.1683651006.5.1.1683652476.0.0.0; _gat_gtag_UA_143679184_2=1; _ga_FNS14GD7LR=GS1.1.1683649181.5.1.1683652476.0.0.0; _ga=GA1.1.271517619.1683271357; ab.storage.sessionId.b2062aeb-858c-41cc-b98c-ff2aaec84951=%7B%22g%22%3A%229e7c7b4f-e477-c1a2-a3be-65b345dd1a04%22%2C%22e%22%3A1683654277264%2C%22c%22%3A1683649181475%2C%22l%22%3A1683652477264%7D; nol_fpid=44qwg6pw9iyo0s4gs1iw4zvmzksjg1683271357|1683271357208|1683652477454|1683652477740; KP_UIDz=09D5jghUW6e3YRJ7bntuXEj456LedaOxPWtunYA7uthdNrrmQTe8Gq9vTpOB4oHLhKFwmtQl9HK5IWXkhlEusn12QZyohoHWyVv6g1H2fPulPYyTD9cYyRN6LTar08iAYei1tyJHY01qI7KIxlbl9CmJfyB9AYZdyWTQJNxgP58dAva4SlHpERRFLVgDPDz; KP_UIDz-ssn=09D5jghUW6e3YRJ7bntuXEj456LedaOxPWtunYA7uthdNrrmQTe8Gq9vTpOB4oHLhKFwmtQl9HK5IWXkhlEusn12QZyohoHWyVv6g1H2fPulPYyTD9cYyRN6LTar08iAYei1tyJHY01qI7KIxlbl9CmJfyB9AYZdyWTQJNxgP58dAva4SlHpERRFLVgDPDz',
  'newrelic': 'eyJ2IjpbMCwxXSwiZCI6eyJ0eSI6IkJyb3dzZXIiLCJhYyI6IjEzMDExIiwiYXAiOiIxODM0ODM1MjkxIiwiaWQiOiI4ODEzODFhMzM3OGY4ODg5IiwidHIiOiI4NDFjMWI2ZDM4OWFjNzE1ZTQ4NDkxMTZhNmJlZjkwMCIsInRpIjoxNjgzNjUyNDc4MjYyLCJ0ayI6IjEwMjI2ODEifX0=',
  'origin': 'https://www.property.com.au',
  'pragma': 'no-cache',
  'referer': 'https://www.property.com.au/',
  'sec-ch-ua': '"Chromium";v="112", "Google Chrome";v="112", "Not:A-Brand";v="99"',
  'sec-ch-ua-mobile': '?0',
  'sec-ch-ua-platform': '"Windows"',
  'sec-fetch-dest': 'empty',
  'sec-fetch-mode': 'cors',
  'sec-fetch-site': 'same-origin',
  'traceparent': '00-841c1b6d389ac715e4849116a6bef900-881381a3378f8889-01',
  'tracestate': '1022681@nr=0-1-13011-1834835291-881381a3378f8889----1683652478262',
  'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36',
  'x-kpsdk-cd': '{"workTime":1683652478204,"id":"b1ea611acce10dc954502a0b916fd1f3","answers":[6,13],"duration":3.7,"d":53,"st":1683652476003,"rst":1683652476056}',
  'x-kpsdk-ct': '07qxSv40h7FnTvonbyw30ym7QD0XCYJcOxsY1Ecti1SbN79RwhKMWELtkdHEelWX47LdYYNZRiRWtN2cqZczFk7bL82n1q8OGeVBs79uMo9Bwd8GZIHNa0lJRkVgiLX0J0osCceGbuJ7mNJY2VFaP6M6KcMJMHIHpQSOZJfodu28E2rflD29pWX51UHF47h'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)


source https://stackoverflow.com/questions/76211978/graphql-request-no-body-returned-for-response-in-postman

Comments

Popular posts from this blog

Why is my reports service not connecting?

I am trying to pull some data from a Postgres database using Node.js and node-postures but I can't figure out why my service isn't connecting. my routes/index.js file: const express = require('express'); const router = express.Router(); const ordersCountController = require('../controllers/ordersCountController'); const ordersController = require('../controllers/ordersController'); const weeklyReportsController = require('../controllers/weeklyReportsController'); router.get('/orders_count', ordersCountController); router.get('/orders', ordersController); router.get('/weekly_reports', weeklyReportsController); module.exports = router; My controllers/weeklyReportsController.js file: const weeklyReportsService = require('../services/weeklyReportsService'); const weeklyReportsController = async (req, res) => { try { const data = await weeklyReportsService; res.json({data}) console...

How to show number of registered users in Laravel based on usertype?

i'm trying to display data from the database in the admin dashboard i used this: <?php use Illuminate\Support\Facades\DB; $users = DB::table('users')->count(); echo $users; ?> and i have successfully get the correct data from the database but what if i want to display a specific data for example in this user table there is "usertype" that specify if the user is normal user or admin i want to user the same code above but to display a specific usertype i tried this: <?php use Illuminate\Support\Facades\DB; $users = DB::table('users')->count()->WHERE usertype =admin; echo $users; ?> but it didn't work, what am i doing wrong? source https://stackoverflow.com/questions/68199726/how-to-show-number-of-registered-users-in-laravel-based-on-usertype

The number of nodes and edges I calculated manually and by a method provided by networkx library dont match

I am trying to analyse a graph using networkx library in Python. I have implemented a function that returns the nodes and edges of that graph. After that I counted the number of nodes and edges by implementing the len() function for nodes and edges, which gave me 17 for both nodes and edges. However, when I used the method graph.number_of_nodes() of networkx library it gave me 53. My code: import pandas as pd import networkx as nx import matplotlib.pyplot as plt header_list = ["a","b","w"] E =pd.read_csv("aves-barn-swallow-contact-network.edges",sep=" ",header= None,names=header_list) # print(E.head()) # prints first few rows of the csv file G = nx.from_pandas_edgelist(E,"a","b",["w"]) nx.draw(G) plt.show() class GraphAnalyse: #finding nodes and edges def nodeEdge(self,Graph): nodes = Graph.nodes() edges = Graph.edges() ...