I don't know almost anything about JavaScript, and I can't stop to study it now... but I need a basic code to print just one line of a http response request (JSON:GET method). For example, I have the URL "http://myurl.com.br", that returns me the following JSON response:
{
"token": {
"token": "randomtoken",
"result": 1,
"resultCode": "2",
"requestId": "3"
}}
What I need is, when I call the script in JavaScript, it have to return me just: "randomtoken".
Another example, I have this python script that returns me the same:
import requests as req
resp = req.get("http://myurl.com.br")
token_key = resp.json()['token']['token']
print(token_key)
How I could do the same, but in JavaScript?