Answer the question
In order to leave comments, you need to log in
How to get response from http server?
var fetch = require('node-fetch');
function getcode(data) {
fetch("http://127.0.0.1:9000/?"+data, {
method: 'GET',
body: null,
headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(return json)//как сделать чтобы ретурн работал?
}
var code = getcode("данные_на_сервер")
console.log(code)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question