Jun 01, 2022 02:09 PM
I am creating a proof of concept script which you can see below:
const data = { title: 'AirTable Pusher', content: 'Push, push, push this.', excerpt: 'The short version' };
let response = await remoteFetchAsync('https://staging2.conveyancingqld.com/the_vision.php', {
method: 'POST',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json',
'Authorization' : 'Basic d2h5d29udHlvdWNvbm5lY3Q6Y2N1WSAxWWhkIDdsTmkgMzdWSSB5MVlyIDYySEs='
},
});
console.log(response);
The return on the server side if you check at the time of this writing is:
{“a”:1,“b”:2,“c”:3,“d”:4,“e”:5}
It returns some JSON data - I want to access that in the AirTable script - however when I check the Console log response it says the following:
{type: "basic", url: "https://staging2.conveyancingqld.com/the_vision.php", status: 200, statusText: "OK", ok: true…}
type: "basic"
url: "https://staging2.conveyancingqld.com/the_vision.php"
status: 200
statusText: "OK"
ok: true
headers: Object
redirected: false
Without any reference to the JSON that is returned.
How do I access the JSON variables returned?
Solved! Go to Solution.
Jun 01, 2022 04:09 PM
Hi @Kosta_Kondratenko
I think you need to turn the response into JSON. Try:
let json = response.JSON()
Jun 01, 2022 04:09 PM
Hi @Kosta_Kondratenko
I think you need to turn the response into JSON. Try:
let json = response.JSON()
Jun 01, 2022 05:37 PM
Thank you! It worked!
I think I was trying with response.json without the brackets ().
Really appreciate it and will mark your answer as solution :pray: